source
stringlengths
3
86
python
stringlengths
75
1.04M
fn_api_runner.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
performance_measures.py
from Switch_Register_Manager import CustomConsole import sys, os, subprocess, time import argparse, threading from timeit import default_timer as timer from scapy.all import * from scapy.layers.inet import UDP, IP from scapy.layers.l2 import Ether currentdir = os.path.dirname(os.path.realpath(__file__)) parentdir = ...
threading_example.py
import threading import time def example_func(name, sec): time.sleep(sec) print(name) threads = [] items = [["thread1", 10], ["thread2", 3], ["thread3", 5]] for item in items: processthread = threading.Thread(target=example_func,args=(item[0], item[1])) processthread.daemon=True threads.append(pr...
gnmi_sub_on_change.py
#!/usr/bin/env python # Copyright 2013-present Barefoot Networks, 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 ...
idom.py
import sys import shutil import asyncio from functools import partial from threading import Thread from queue import Queue as SyncQueue from packaging.version import Version from ..io.notebook import push_on_root from ..io.resources import DIST_DIR, LOCAL_DIST from ..io.state import state from ..models import IDOM as...
__init__.py
# Python framework import sys, os, json, re import threading import datetime from pprint import pprint from Constants import * from Hashes import * from PathUtils import * from PluginSupport import * from Serialization import * from StringUtils import * from TimeZoneUtils import * from titlecase import * ...
MainFrame.py
# coding: utf-8 #!/usr/bin/python #from win32com.client import Dispatch #for internalmodule compile #from PFPLib.InternalModules.FileFormatAnalyzer import * from PFPLib.InternalModules.TSK_Extractor import * from PFPLib.InternalModules.SampleCLIModule import * from PFPLib.InternalModules.SampleGUIModule import * ...
i3block.py
# -*- coding: utf-8 -*- """ Support i3blocks blocklets in py3status. i3blocks, https://github.com/vivien/i3blocks, is a project to allow simple scripts to provide output to the i3bar. This module allows these blocklets to run under py3status. The configuration of the blocklets is similar to how they are configured in ...
sagittarius.py
import dataManagement import threading import math import time import sockServer import html class gameMap: def __init__(self, width, height): self.width = width self.height = height def getInfo(self): info = {} info[sockServer.gameMap.height.value] = self.height info[so...
rdd.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
test_urllib.py
"""Regresssion tests for urllib""" import urllib.parse import urllib.request import urllib.error import http.client import email.message import io import unittest from unittest.mock import patch from test import support import os import ssl import sys import tempfile from nturl2path import url2pathname, pathname2url ...
main.py
import asyncio import datetime import json import logging import queue import threading import time from typing import List from elasticsearch import Elasticsearch from sqlalchemy import create_engine from sqlalchemy.exc import SQLAlchemyError, DBAPIError from sqlalchemy.orm import sessionmaker import validators imp...
rest_server.py
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer from SocketServer import ThreadingMixIn import threading import argparse import re import cgi import json import xmlrpclib s = xmlrpclib.ServerProxy('http://localhost:8000') class LocalData(object): records = {} class HTTPRequestHandler(BaseHTTPRequ...
email.py
from threading import Thread from flask import render_template from flask_mail import Message from app import app, mail def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_email(subject, sender, recipients, text_body, html_body): msg = Message(subject, sender=sender, reci...
__init__.py
import sys import io import time import json import threading import traceback import collections import bisect try: import Queue as queue except ImportError: import queue # Patch urllib3 for sending unicode filename from . import hack from . import exception __version_info__ = (12, 7) __version__ = '.'.jo...
audio.py
# coding=utf-8 # # Yu Wang (University of Yamanashi) # Mar, 2020 # # 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 appl...
PDF2Audiobook.py
import os os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide" from gtts import gTTS from googletrans import Translator import PyPDF2 import pygame from pygame import mixer from pathlib import Path import tkinter from tkinter import * from tkinter import ttk from googletrans import Translator import threading import win3...
test_data_node_scale.py
import threading import time import pytest from base.collection_wrapper import ApiCollectionWrapper from common.common_type import CaseLabel from common import common_func as cf from customize.milvus_operator import MilvusOperator from scale import constants, scale_common from pymilvus import connections, MilvusExcep...
controller.py
import glob import json import os import re import shutil import subprocess import tarfile import time import traceback from datetime import datetime from math import floor from pathlib import Path from pwd import getpwnam from threading import Thread from typing import List, Set, Type, Tuple, Dict, Iterable, Optional,...
pymolhttpd.py
# Copyright (C) Schrodinger, LLC. # All Rights Reserved # # For more information, see LICENSE in PyMOL's home directory. # # pymolhttpd.py # # web server interface for controlling PyMOL from __future__ import print_function # we make extensive use of Python's build-in in web infrastructure import BaseHTTPServer, cgi...
app.py
from flask import Flask, jsonify, request, Response from bson.json_util import dumps from flask_cors import CORS, cross_origin from pymongo import MongoClient import os, threading, random, time ##### INITIALIZATION ##### app = Flask(__name__) CORS(app) client = MongoClient("mongodb://{}:{}@{}".format(os.getenv("DB_U...
postproc.py
import os import sys import argparse import time import socket import json import subprocess import threading import queue import itertools import urllib3 import logging from logging.handlers import TimedRotatingFileHandler from datetime import datetime, timedelta from functools import partial def make_thread(fn, *arg...
pyro4_server.py
# pyro4_server.py import logging import os import uuid import signal import threading import time import datetime import Pyro4 from Pyro4.util import SerializerBase from support.logs import logging_config from support.tunneling import Tunnel, TunnelingException from pyro3_util import full_name from pyro4_util import ...
_thread.py
import threading import time def throws(f,args:tuple=tuple())->None: if not isinstance(args,tuple): args=(args,) _t=threading.Thread(target=f,args=args) _t.setDaemon(True) _t.start() return _t class nThread: def __init__( self, n:int=16, waits:int=0, f=None, args:list=None, fast:...
bsv-ds-bad-callback-service.py
#!/usr/bin/env python3 # Copyright (c) 2021 The Bitcoin SV developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import threading, json import http.client as httplib from functools import partial from http.server import HTTPS...
generator.py
import logging import re from threading import Thread from django.conf import settings import api_reader from layers.defined import DefinedLayer from layers.definitions import DefinitionsLayer from layers.external_citation import ExternalCitationLayer from layers.formatting import FormattingLayer from layers.internal...
agent.py
import json from signal import signal, SIGTERM from multiprocessing import Process from leek.agent.logger import get_logger from leek.agent.consumer import LeekConsumer logger = get_logger(__name__) class LeekAgent: """Main server object, which: - Load subscriptions from config file. - Orchestr...
test_nanny.py
import asyncio import gc import logging import multiprocessing as mp import os import random from contextlib import suppress from time import sleep from unittest import mock import psutil import pytest pytestmark = pytest.mark.gpu from tlz import first, valmap from tornado.ioloop import IOLoop import dask from dis...
FTPBruteForce.py
# uncompyle6 version 2.11.5 # Python bytecode 2.7 (62211) # Decompiled from: Python 2.7.18 (default, Apr 20 2020, 20:30:41) # [GCC 9.3.0] # Embedded file name: BruteForce\FTPBruteForce.py import requests import re import socket import ftplib import threading import time Headers = {'User-Agent': 'Mozilla/5.0 (X11; Ubun...
installer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' The main purpose of this script is to provide the core framework for a printer installation in the form of a dropdown list. It was designed to be used in many different situations such as Jamf Self Service, Apple Remote Desktop, manually triggered by a technitian, or as...
store.py
import datetime import json import threading import uuid from collections import defaultdict from copy import deepcopy from dictdiffer import diff from inspect import signature from threading import Lock from pathlib import Path from tzlocal import get_localzone from .logger import logger from .settings import CACHE_...
scriptTools.py
from __future__ import division, absolute_import, print_function # -*- coding: UTF-8 -*- import __future__ import AppKit import time import os import sys import traceback import site import re import warnings from signal import SIGINT import ctypes from ctypes.util import find_library import threading from distutils.v...
binja_gef.py
""" This script is the server-side of the XML-RPC defined for gef for BinaryNinja. It will spawn a threaded XMLRPC server from your current BN session making it possible for gef to interact with Binary Ninja. To install this script as a plugin: $ ln -sf /path/to/gef/binja_gef.py ~/.binaryninja/plugins/binaryninja_gef....
web.py
# Electrum - lightweight Bitcoin client # Copyright (C) 2011 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights t...
nbsp.py
# -*- coding: utf-8 -*- import time from threading import Thread, Event from six.moves import queue import logging LOGGING = logging.getLogger(__name__) class NonBlockingStreamReader: def __init__(self, stream, raise_EOF=False, print_output=True, print_new_line=True, name=None): ''' stream: the st...
test_aws_automated.py
""" These tests require an AWS account to be set up, but don't require any manual intervention beyond some initial setup. Also, these tests create instances (which cost money!). Either `meadowrun-manage install` needs to be set up, or `meadowrun-manage clean` needs to be run periodically """ import asyncio import date...
win32gui_dialog.py
# A demo of a fairly complex dialog. # # Features: # * Uses a "dynamic dialog resource" to build the dialog. # * Uses a ListView control. # * Dynamically resizes content. # * Uses a second worker thread to fill the list. # * Demostrates support for windows XP themes. # If you are on Windows XP, and specify a '--noxp' ...
telemetry_status.py
import pandas as pd import re from builtins import hasattr from datetime import datetime, timedelta import requests from flask import request, current_app as app from mongo_orm import MongoDB, AnyField from oadr_core.exceptions import InvalidReportException from oadr_core.oadr_payloads.oadr_payloads_general import EL...
plugin.py
#!/usr/bin/env/python # # -*- coding: utf-8 -*- ### # Copyright (c) 2016, Nicolas Coevoet # 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 must retain the ab...
estimator.py
""" """ import pickle import copy from functools import partial from multiprocessing import Process, Pipe import time from sklearn.base import BaseEstimator from sklearn.metrics import accuracy_score, r2_score from sklearn.decomposition import PCA try: from sklearn.model_selection import KFold, StratifiedKFold, Lea...
cachingFileStore.py
# Copyright (C) 2015-2021 Regents of the University of California # # 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...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs import logging import getpass import multiprocessing import fnmatch import copy import os import hashlib import re import types import threading import time import traceback import sys import signal from random import randint # Import th...
data_plane.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
test_emit.py
import asyncio import threading from unittest import mock import pytest pytestmark = pytest.mark.asyncio async def test_emit_full_queue(setup_logger, loop, mocker): log, hdlr, srv = await setup_logger(qsize=1, close_timeout=0.01) fut = asyncio.Future(loop=loop) async def coro(record): await f...
face_tracker.py
import threading import time import argparse import cv2 import json import os import numpy as np import dlib from itertools import chain config_data = {} should_face_tracking_be_paused = False detector = dlib.get_frontal_face_detector() def set_config_data(data_in): global config_data config_data = data_in...
test_clientsocket.py
# -*- coding: UTF-8 -*- # # Tencent is pleased to support the open source community by making QTA available. # Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved. # Licensed under the BSD 3-Clause License (the "License"); you may not use this # file except in compliance with the License. You may...
GPIO.py
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # ## ############################################################# # GPIO.py # # Author: Mauricio Matamoros # Licence: MIT # Date: # # ## ############################################################# # Future imports (Python 2.7 compatibility) from __future__ import abso...
main_window.py
#!/usr/bin/env python # # ElectrumSys - lightweight Syscoin 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 wi...
baking_mx200.py
import logging import sys, os import numpy as np sys.path.append('../') sys.modules['cloudpickle'] = None import threading import time from pymeasure.display.Qt import QtGui from pymeasure.display.windows import ManagedWindow from pymeasure.experiment import Procedure, Results from pymeasure.experiment import Intege...
response_time.py
import time import threading from metrics.metric import Metric from datetime import datetime import numpy as np METRIC_NAME = 'Response_Time' VALUE_FIELD = 'value' UNIT_FIELD = 'unit' class ResponseTime(Metric): def __init__(self, conf_path='conf/conf.json'): super().__init__(conf_path) def compute...
wrapper_3d.py
from django.http import HttpResponseRedirect, HttpResponse #, HttpResponseBadRequest, HttpResponseNotFound, HttpResponseServerError from django.shortcuts import render from datetime import datetime import simplejson import sys import threading import time import traceback from src.helper import * from src.helper_form...
decorators.py
""" Copyright (c) 2019 The Cereja Project 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, publish, distrib...
core.py
import logging import telebot import time from threading import Thread import config from addons import strings, file_manager from apps.valve_api import ValveServersAPI from apps.web import PeakOnline, Monthly api = ValveServersAPI() peak_count = PeakOnline() month_unique = Monthly() def info_updater(): while...
condition_tut.py
import random, time from threading import Condition, Thread """ 'condition' variable will be used to represent the availability of a produced item. """ condition = Condition() box = [] def producer(box, nitems): for i in range(nitems): time.sleep(random.randrange(2, 5)) condition.acquire() ...
main_window.py
#!/usr/bin/env python3 # # 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 with...
dask.py
# pylint: disable=too-many-arguments, too-many-locals # pylint: disable=missing-class-docstring, invalid-name # pylint: disable=too-many-lines """Dask extensions for distributed training. See https://xgboost.readthedocs.io/en/latest/tutorials/dask.html for simple tutorial. Also xgboost/demo/dask for some examples. Th...
_http.py
""" Copyright (c) 2019 The Cereja Project 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, publish, distrib...
optimizer.py
import math import time from datetime import datetime import json import os import numpy as np from ccxt import Exchange from tradingkit.cli.runner import Runner from tradingkit.data.feed.feeder import Feeder from tradingkit.display.plotter import Plotter from tradingkit.strategy.strategy import Strategy from tradingk...
server.py
from socket import * import threading import os import sys from colors import print_color, format_string from connection import set_connection SERVER_SOCKET = socket(AF_INET, SOCK_STREAM) CLIENTS = list() ADDRESSES = list() USERS = list() SERVER_IP = '' SERVER_PORT = 0 def print_connections(): os.system('cls'...
pipe_in.py
import time from abc import ABC from threading import Thread from typing import Any, Optional, Union from bson import ObjectId from linebot.models import TextMessage, ImageMessage, StickerMessage, MessageEvent from discord import Message, ChannelType from extutils.emailutils import MailSender from flags import Platfo...
upgrade_wheels.py
""" Helper script to rebuild virtualenv_support. Downloads the wheel files using pip """ from __future__ import absolute_import, unicode_literals import os import shutil import subprocess import sys from collections import OrderedDict, defaultdict from pathlib import Path from tempfile import TemporaryDirectory from t...
engine.py
""" """ import logging from logging import Logger import smtplib import os from abc import ABC from datetime import datetime from email.message import EmailMessage from queue import Empty, Queue from threading import Thread from typing import Any, Type, Dict, List, Optional from vnpy.event import Event, EventEngine f...
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...
game.py
"""Connect Four game logic""" import os, sys import random import numpy as np import time import traceback from enum import Enum from copy import copy, deepcopy from threading import Thread from enum import Enum, auto from . import helpers from .timer import Chronometer, Timer from .agents import AgentRandom, AgentHuma...
trezor.py
from binascii import hexlify, unhexlify from collections import defaultdict import traceback import sys from electroncash.util import bfh, bh2u, versiontuple, UserCancelled from electroncash.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, deserialize_xpub, TYPE_ADDRESS, TYPE...
b2_client.py
#!/usr/bin/env python import time, random import Pyro.core import Pyro.naming from Pyro.errors import * from threading import Thread import bouncer2 abort=0 def PyroLoop(daemon): global abort print 'Pyro daemon loop thread is running.' daemon.requestLoop(lambda: not abort) print 'Pyro daemon loop thread is exit...
test.py
# -*- coding: utf-8 -*- # time: 2017/9/29 9:56 import pyselog import threading logger = pyselog.create_logger('mycrawl', fileloglevel=4) def dolog(): logger.info('info') logger.error('error') if __name__ == '__main__': t1 = threading.Thread(target=dolog, name='haha') t1.start() t1.join()
test_interpreters.py
import contextlib import os import threading from textwrap import dedent import unittest import time from test import support from test.support import import_helper _interpreters = import_helper.import_module('_xxsubinterpreters') from test.support import interpreters def _captured_script(script): r, w = os.pipe...
pubsub.py
# -*- coding: utf-8 -*- ############################################## # The MIT License (MIT) # Copyright (c) 2018 Kevin Walchko # see LICENSE for full details ############################################## from .udpsocket import SocketUDP from .ip import get_ip from threading import Thread from colorama import Fore ...
mathematics.py
import discord from discord.ext import commands import sys sys.path.append('../') from main import config_load, increment_command_counter import math import re import cmath import matplotlib.pyplot as plt import numpy as np import sympy from utils import is_int, is_float from forex_python.converter import CurrencyRates...
kplexes.py
# coding: utf-8 # Libs, Settings & Utils import multiprocessing import signal import networkx as nx import math #import matplotlib.pyplot as plt from collections import defaultdict import os import time from subprocess import call, DEVNULL import uuid from datetime import datetime from random import shuffle import sy...
server.py
# Anthony Tiongson import threading, time, random, socket def server(): try: serverSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) print("Server socket created...") except socket.error as socketError: print('Socket already open, error: {}\n'.format(socketError)) ...
publish_msg_1_generate_output.py
#!/usr/bin/env python import roslib import rospy import smach import smach_ros from geometry_msgs.msg import Point from geometry_msgs.msg import Point32 from geometry_msgs.msg import PointStamped from geometry_msgs.msg import Pose from geometry_msgs.msg import PoseStamped from geometry_msgs.msg import Quate...
equipment_alarm_min_max.py
# encoding: utf-8 import datetime import json import logging import threading import time from queue import Queue import psycopg2.extras import requests from influxdb import InfluxDBClient # 定义报警规则读取时间间隔(秒) GZ_READ_TIME = 10 * 60 # 定义报警规则处理时间间隔(秒) GZ_HANDLE_TIME = 5 # 定义数据查询向前偏移时间(秒) SJ_XQPY = 8 * 60 * 60 + 5 # 定义获取规...
block_push.py
import torch import math import threading import Tkinter as tk import mushr_rhc.utils as utils class BlockPush: def __init__( self, params, logger, dtype, map, world_rep, value_fn, viz_rollouts_fn ): self.params = params self.logger = logger self.dtype = dtype self.map ...
websocket.py
import asyncio import json import logging import os from threading import ( Thread, ) from types import ( TracebackType, ) from typing import ( Any, Optional, Type, Union, ) from eth_typing import ( URI, ) from websockets.client import ( connect, ) from websockets.legacy.client import (...
jobs.py
# -*- coding: utf-8 -*- # # 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 #...
Soccerbot_Motor_Movement_Threading.py
#!/usr/bin/python # coding: utf-8 #---------------------------------------------------------------- # Adapted from work done by: #Autor: Saymon C. A. Oliveira # Email: saymowan@gmail.com # Descrição: este algoritmo descreve a sexta implementação de OpenCV # Funções: Imagem digital -> Transformação HSV -> Imagem binár...
tesseract_recognize_api.py
#!/usr/bin/env python3 """Command line tool for the tesseract-recognize API server.""" """ @version $Version: 2020.01.13$ @author Mauricio Villegas <mauricio_ville@yahoo.com> @copyright Copyright(c) 2017-present, Mauricio Villegas <mauricio_ville@yahoo.com> @requirements https://github.com/omni-us/pagexml/releases/do...
multithreading_test.py
# Copyright 2019 Nativepython 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 applicable law or a...
CanvasItem.py
""" CanvasItem module contains classes related to canvas items. """ # standard libraries import collections import contextlib import copy import enum import functools import imageio import logging import operator import sys import threading import typing import warnings import weakref # third party libraries impo...
unix_agent.py
# # Copyright (c) 2015 Nutanix Inc. All rights reserved. # # Thread-safety: all the web and API HTTP handlers are thread-safe. All other # methods (e.g., run) are meant to be called one time and from a single caller, # the main curie_unix_agent program. # import errno import logging import os import pwd import re impo...
main.py
from flask import Flask,redirect,render_template,request,url_for, session,jsonify from datetime import datetime from flask import send_file import undetected_chromedriver as uc from selenium.webdriver.common.by import By import time import os import glob from selenium.webdriver.support.ui import WebDriverWait from thre...
test_sys.py
import builtins import codecs # import gc import locale import operator import os import struct import subprocess import sys import sysconfig import test.support from test import support from test.support import os_helper from test.support.script_helper import assert_python_ok, assert_python_failure from test.support i...
plotter.py
"""Renders rollouts of the policy as it trains.""" import atexit from collections import namedtuple from enum import Enum import platform from queue import Queue from threading import Thread import numpy as np import tensorflow as tf from garage.sampler.utils import rollout as default_rollout __all__ = ['Plotter'] ...
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_concurrency.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for concurrency libraries.""" import glob import os import random import re import sys import threading import time from flaky import flaky import pytest...
update_site_data.py
#!/usr/bin/env python3 """Maigret: Supported Site Listing with Alexa ranking and country tags This module generates the listing of supported sites in file `SITES.md` and pretty prints file with sites data. """ import json import sys import requests import logging import threading import xml.etree.ElementTree as ET from...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin Core 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 i...
test_browser.py
# coding=utf-8 # Copyright 2013 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. from __future__ import print_function import argparse ...
main.py
import json import re import os import requests import traceback from datetime import datetime from hashlib import md5 from pathlib import Path from queue import Queue from random import randint from subprocess import call, PIPE from threading import Thread, Lock from time import sleep from time import time from types ...
ali_sync.py
#!/usr/bin/env python2 # coding:utf-8 import base64 import copy import errno import getopt import json import logging import os import sys import threading import time import traceback import boto3 import oss2 import yaml from botocore.client import Config from pykit import jobq report_state_lock = threading.RLock(...
example.py
#!/usr/bin/python # -*- coding: utf-8 -*- import flask from flask import Flask, render_template from flask_googlemaps import GoogleMaps from flask_googlemaps import Map from flask_googlemaps import icons import os import re import sys import struct import json import time import requests import argparse import getpass...
PeopleFaceIdentification.py
#! /usr/bin/env python __author__ ='Jacques Saraydaryan' import os import sys import numpy as np from cv_bridge import CvBridge, CvBridgeError #sys.path.append(os.path.dirname(__file__) + "/../pose-tensorflow/") #sys.path.append("/opt/ros/kinetic/lib/python2.7/dist-packages/") # ROS import rospy from sensor_msgs.msg ...
wsdump.py
#!c:\python27\python.exe import argparse import code import sys import threading import time import six from six.moves.urllib.parse import urlparse import websocket try: import readline except ImportError: pass def get_encoding(): encoding = getattr(sys.stdin, "encoding", "") if not encoding: ...
mk.py
#!/usr/bin/python3 """ Top level entry point for NQBP (i.e. called by the project-being-built's mk.py) """ #============================================================================= # ENVIRONMENT VARIABLES # --------------------- # REQUIRED: # NQBP_BIN Path to the directory of where (and/or which ve...
fileanalyze.py
#coding=utf-8 import sys, os import time from PyQt4 import QtCore, QtGui import hashlib import numbers import array import math import pefile import magic import sqlite3 import re import urlparse import Queue import threading sys.path.append("../") from globalset import ImpAlert ''' 通用除法操作 可统一py2/3 ''' def commonDiv(...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Ocean 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 without...
esi_processor.py
# esi_processor.py import threading from PySide2 import QtCore from .esi.esi import ESI class ESIProcessor(QtCore.QObject): """ ESI Middleware """ login_response = QtCore.Signal(str) logout_response = QtCore.Signal() location_response = QtCore.Signal(str) destination_response = QtCore.Signal(bool) ...
client.py
import socket import threading import json import tkinter import tkinter.messagebox from tkinter.scrolledtext import ScrolledText IP = '' PORT = '' user = '' # user list box listbox1 = '' # 是否開關user listf ii = 0 # user list users = [] chat = '------Group chat-------' # Log in 的視窗 root1 = tkinter.Tk() root1.title('Log...