source
stringlengths
3
86
python
stringlengths
75
1.04M
handlers.py
# Copyright 2001-2015 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
load_test_client.py
# Copyright 2018 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...
ClientDaemons.py
from . import ClientImporting from . import ClientImportOptions from . import ClientImportFileSeeds from . import ClientPaths from . import ClientThreading from . import HydrusConstants as HC from . import HydrusData from . import HydrusExceptions from . import HydrusGlobals as HG from . import HydrusNATPunch from . im...
power_monitoring.py
import datetime import random import threading import time from statistics import mean from cereal import log from selfdrive.swaglog import cloudlog PANDA_OUTPUT_VOLTAGE = 5.28 # Parameters def get_battery_capacity(): return 77 # _read_param("/sys/class/power_supply/battery/capacity", int) def get_battery_statu...
test_io.py
"""Unit tests for the io module.""" # Tests of io are scattered over the test suite: # * test_bufio - tests file buffering # * test_memoryio - tests BytesIO and StringIO # * test_fileio - tests FileIO # * test_file - tests the file interface # * test_io - tests everything else in the io module # * test_univnewlines - ...
app.py
''' https://github.com/realpython/flask-boilerplate ''' import json from flask import Flask, render_template, jsonify import logging from logging import Formatter, FileHandler import threading import time from turbo_flask import Turbo from busstop import getStops update_interval=15 app = Flask(__name__) turbo = Turbo...
piecewise.py
import argparse import os import sqlite3 import sys import threading import time import traceback from voussoirkit import bytestring from voussoirkit import downloady from voussoirkit import pipeable DEFAULT_PIECE_SIZE = bytestring.MIBIBYTE DEFAULT_THREAD_COUNT = 10 def init(url, localname=None, piece_size=DEFAULT_P...
test_util.py
# Copyright 2015 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...
installwizard.py
import os import sys import threading import traceback from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from electrum import Wallet, WalletStorage from electrum.util import UserCancelled, InvalidPassword from electrum.base_wizard import BaseWizard, HWD_SETUP_DECRYPT_WALLET from elec...
wallet_multiwallet.py
#!/usr/bin/env python3 # Copyright (c) 2017-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test multiwallet. Verify that a bitcoind node can load multiple wallet files """ from decimal import D...
reachy_state_machine.py
#!/usr/bin/env python import rospy import smach import threading import moveit_commander import sys from state_machine.idle_state import Idle from state_machine.greet_state import Greet from state_machine.has_mask_state import HasMask from state_machine.no_mask_state import NoMask from state_machine.goodbye_state imp...
helpers.py
""" Helper functions file for OCS QE """ import base64 import datetime import hashlib import json import logging import os import re import statistics import tempfile import threading import time import inspect from concurrent.futures import ThreadPoolExecutor from itertools import cycle from subprocess import PIPE, Ti...
__init__.py
import time FirstTime = time.time() import os import io import sys import time import glob import socket import locale import hashlib import tempfile import datetime import subprocess from ctypes import windll from urllib.request import urlopen import psutil import win32gui import win32api import pythoncom import wi...
viewing.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* --------...
tests.py
import time import traceback from datetime import date, datetime, timedelta from threading import Thread from django.core.exceptions import FieldError from django.db import DatabaseError, IntegrityError, connection from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature from django.utils.functional ...
email.py
# from flask_mail import Message # from app import mail # from flask import render_template # from app import app # from threading import Thread # def send_email(subject, sender, recipients, text_body, html_body): # msg = Message(subject, sender=sender, recipients=recipients) # msg.body = text_body # msg....
solr_tools.py
#coding=utf-8 # Copyright (c) 2018 Baidu, 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 ...
trassir_script_framework.py
# -*- coding: utf-8 -*- """ <parameters> <company>AATrubilin</company> <title>trassir_script_framework</title> <version>0.65</version> </parameters> """ # _SERVICE_VERSION = 0.66 _TBOT_SERVICE = """ ws6NddMiBzOnv07z50KyTBIvoarbeMFBTRba1CEwNlGH3XVTTLfL1Jluc664MSlqqbrnjkwl g8smB1yytf2QdAoTovLH8EnQEce...
mitm.py
#! /usr/bin/env python2 # # # Written by Rupe 11-22-2015 from __future__ import print_function from logging import getLogger, ERROR getLogger("scapy.runtime").setLevel(ERROR) from scapy.all import * from commands import getoutput from multiprocessing import Process from subprocess import call from os import system fro...
Bootstrapper.py
#! /usr/bin/python3 # # 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 "Licen...
tkgui.py
"""Tkinter GUI code.""" import os import sys import json import logging import threading import dtoolcore.utils import tkinter as tk import tkinter.ttk as ttk import tkinter.filedialog as fd import tkinter.messagebox as mb from idlelib.tooltip import Hovertip from dtool_gui_tk.models import ( LocalBaseURIMode...
history.py
""" Implementations for the history of a `Buffer`. NOTE: Notice that there is no `DynamicHistory`. This doesn't work well, because the `Buffer` needs to be able to attach an event handler to the event when a history entry is loaded. This loading can be done asynchronously and making the history swapp...
framework.py
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # Also available under a BSD-style license. See LICENSE. """ # End-to-end testing framework for TorchScript. For the purp...
main.py
import socket import threading import binascii import asyncio import time import json import datetime import struct import traceback from avlDecoder import avlDecoder from apiControl import postRequest avl_decoder = avlDecoder() post_requester = postRequest() class TCPServer(): def __init__(self, port): ...
loader.py
# Copyright 2004-2021 Tom Rothamel <pytom@bishoujo.us> # # 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...
test_http.py
import asyncio import contextlib import os import sys import threading from http.server import BaseHTTPRequestHandler, HTTPServer import pytest import fsspec.asyn import fsspec.utils fsspec.utils.setup_logging(logger_name="fsspec.http") requests = pytest.importorskip("requests") port = 9898 data = b"\n".join([b"som...
videocaptureasync.py
# file: videocaptureasync.py import threading import cv2 class VideoCaptureAsync: def __init__(self, src=0, width=640, height=480): self.src = src self.cap = cv2.VideoCapture(self.src) self.cap.set(cv2.CAP_PROP_FRAME_WIDTH, width) self.cap.set(cv2.CAP_PROP_FRAME_HEIGHT, height) ...
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 thres...
hello_threads.py
import threading import time def main(): threads = [ threading.Thread(name="Michael", target=greeter, args=("Michael", 10), daemon=True), threading.Thread(name="Sarah", target=greeter, args=("Sarah", 5), daemon=True), threading.Thread(name="Zoe", target=greeter, args=("Zoe", 2), daemon=Tru...
Pixivic.py
import getopt import sys import datetime import calendar import aiohttp import aiofiles import asyncio import os import multiprocessing from enum import Enum base_uri = 'https://i.pximg.net' origin_uri = 'https://img.cheerfun.dev' class ModeEnum(Enum): DAY = "day" WEEK = "week" MONTH = ...
CatBot_Protect.py
# -*- coding: utf-8 -*- #Cat_Bot import LINETCR from LINETCR.lib.curve.ttypes import * from datetime import datetime import time,random,sys,json,codecs,threading,glob,re,ast,os,subprocess,requests cl = LINETCR.LINE() cl.login(qr=True) #cl.login(token='') cl.loginResult() print "Cl-Login Success\n" ki = LINETCR.LINE(...
duckdb.py
import json import datetime, time import itertools import duckdb import decimal import os import multiprocessing from multiprocessing import Queue from common import util import queue import threading from threading import Thread class IDEBenchDriver: def init(self, options, schema, driver_arg): self.tim...
comm.py
#!/usr/bin/python3 # # This file is part of asadbg. # Copyright (c) 2017, Aaron Adams <aaron.adams(at)nccgroup(dot)trust> # Copyright (c) 2017, Cedric Halbronn <cedric.halbronn(at)nccgroup(dot)trust> # # Tools to use serial / telnet / SSH to issue commands, reboot the router, # transfer files between the host and the r...
labels.py
import hashlib import requests import threading import json import sys import traceback import base64 import electrum_nmc as electrum from electrum_nmc.plugins import BasePlugin, hook from electrum_nmc.i18n import _ class LabelsPlugin(BasePlugin): def __init__(self, parent, config, name): BasePlugin.__...
finder.py
#!/usr/bin/python3 import queue import threading import uuid from BaiduMapAPI import BaiduMapAPI from LagouAPI import LagouAPI from JobDB import db, Job jq = queue.Queue() lock = threading.Lock() done = False def geo_worker(): while True: try: jd = jq.get(timeout=1) except queue.Empt...
manager.py
import typing import retrying import json import logging from kubernetes import client, config, watch from kubernetes.client import V1Pod from flask import Flask from threading import Thread from env_conf import parse_env_vars from db import DBHandler from config_monitor import ConfigMonitor, PodMonitorConfig loggin...
dataset.py
# Copyright 2020 - 2021 MONAI Consortium # 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 wri...
email.py
#coding:utf-8 from threading import Thread from flask import current_app, render_template from flask_mail import Message from . import mail def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_email(to, subject, template, **kwargs): app = current_app._get_current_object() ...
UISendFiles.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import wx from threading import Thread, Semaphore, Lock from envioArchivos.SplitFile import SplitFile from envioArchivos.JoinParts import JoinParts from os.path import dirname # begin wxGlade: dependencies # end wxGlade # begin wxGlade: extracode # end wxGlade class UI...
plot_from_pp_3234_regrid_3_hourly.py
""" Load pp, plot and save """ import os, sys import matplotlib #matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from matplotlib import rc from matplotlib.font_manager import FontProperties from matplotlib import rcParams from mpl_toolkits.basemap import Basemap rc('font', family = ...
DM.py
# importing numpy, pandas, and matplotlib import numpy as np import pandas as pd import matplotlib import multiprocessing matplotlib.use('agg') import matplotlib.pyplot as plt # importing sklearn from sklearn.model_selection import train_test_split from sklearn.model_selection import StratifiedKFold from sklearn.decom...
keep_alive.py
# from flask import Flask, request # from threading import Thread # #import waitress # app = Flask('') # @app.route('/') # def main(): # return "Your bot is alive!" # # @app.route("/dblwebhook", methods=["POST"]) # # def dbl(): # # return "yolo", 200 # def run(): # app.run(host="0.0.0.0", port=8080) # #wai...
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...
web_service.py
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
base.py
from __future__ import absolute_import import multiprocessing import os from typing import TYPE_CHECKING import swf.actors import swf.exceptions import swf.models.decision from simpleflow import format, logger from simpleflow.process import Supervisor, with_state from simpleflow.swf.process import Poller from simplef...
test_wrapper.py
from __future__ import division, absolute_import, print_function __copyright__ = "Copyright (C) 2009 Andreas Kloeckner" __license__ = """ 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 r...
zwave_gateway_device.py
#!/usr/bin/env python3 import logging import serial import time from gateway_devices.generic_gateway_device import GenericGatewayDevice logger = logging.getLogger(__name__) def get_class(): return ZWaveGatewayDevice class ZWaveGatewayDevice(GenericGatewayDevice): NAME = "Aeotec ZStick Gen2" ID_MODEL_ID...
duckypad_autoprofile.py
import time from tkinter import * from tkinter import filedialog from tkinter import simpledialog from tkinter import messagebox import urllib.request import tkinter.scrolledtext as ScrolledText import traceback import json import os import webbrowser import sys import threading import logging import hid_rw import get_...
train_abstractive-checkpoint.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...
notebook_utils.py
#!/usr/bin/env python # coding: utf-8 # In[ ]: import os import shutil import socket import threading import time import urllib import urllib.parse import urllib.request from os import PathLike from pathlib import Path from typing import Callable, List, NamedTuple, Optional, Tuple import cv2 import matplotlib impor...
task_server.py
#!/usr/bin/env python import json import random import re import rospy import threading import uuid from geometry_msgs.msg import PoseWithCovarianceStamped from rospy.exceptions import ROSInterruptException from std_msgs import msg as ros_msg from std_srvs.srv import Empty, EmptyResponse, EmptyRequest import pi_tre...
nodes.py
import importlib import json import logging import multiprocessing import os import shlex import subprocess import sys from collections import OrderedDict from datetime import datetime from typing import List, Type, Union from pkg_resources import resource_filename import magnus from magnus import defaults, utils fro...
duce.py
import json import os import random import re import threading import time import traceback from decimal import Decimal from urllib.parse import parse_qs, unquote, urlsplit import cloudscraper import requests from bs4 import BeautifulSoup as bs from tqdm import tqdm from colors import * # DUCE-CLI # Scraper def dis...
dokku-installer.py
#!/usr/bin/env python2.7 import cgi import json import os import re import SimpleHTTPServer import SocketServer import subprocess import sys import threading VERSION = 'v0.11.1' hostname = '' try: command = "bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || wget -q -O - icanhazip.com'" hostname = s...
bam_to_truth.py
import time import pysam import logging import sys from multiprocessing import Process, Queue from mitty.simulation.sequencing.writefastq import writer, load_qname_sidecar, parse_qname from mitty.simulation.readgenerate import DNA_complement logger = logging.getLogger(__name__) __process_stop_code__ = 'SETECASTRONOMY' ...
gym_environment.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from multiprocessing import Process, Pipe import numpy as np import cv2 import gym import logging from environment import environment COMMAND_RESET = 0 COMMAND_ACTION = 1 COMMAN...
main.py
# multi-threaded function import threading from queue import Queue from spider import Spider from domain import * from general import * PROJECT_NAME = 'thenewboston' # Kind of a constant HOMEPAGE='https://ntrs.nasa.gov' DOMAIN_NAME = get_domain_name(HOMEPAGE) QUEUE_FILE = PROJECT_NAME + '/queue.txt' CRAWLED_FILE = ...
profile_pyros_ros.py
#!/usr/bin/env python from __future__ import absolute_import import cProfile import logging import sys import time import rosgraph import roslaunch import rospy from pyros import PyrosROS roscore_process = None # BROKEN ?? start roscore beofre running this... # if not rosgraph.masterapi.is_online(): # # Trying...
test.py
import gzip import json import logging import os import io import random import threading import time import helpers.client import pytest from helpers.cluster import ClickHouseCluster, ClickHouseInstance, get_instances_dir from helpers.network import PartitionManager from helpers.test_tools import exec_query_with_retr...
sr_hd_test_system.py
# -*- coding: utf-8 -*- """ Created on Tue Jul 28 09:48:35 2020 @author: SZC """ ############################################################################################################## # QtGUI界面 #######################################################################################################...
refactor.py
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Refactoring framework. Used as a main program, this can refactor any number of files and/or recursively descend down directories. Imported as a module, this provides infrastructure to write your own refactor...
datasets.py
import glob # import cv2 import math import os import random import shutil import time from pathlib import Path from threading import Thread import numpy as np import torch from PIL import ExifTags, Image, ImageOps from torch.utils.data import Dataset from tqdm import tqdm from utils.general import to...
test_aws_quantum_task.py
# Copyright 2019-2019 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fil...
trains.py
# coding=utf-8 from lxml import etree from Queue import Queue import threading from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from bs4 import BeautifulSoup import json, re, cto from models import Train, Train_course, Course_lesson from cto import Login login = Login() session = login.login...
c1_SubmitShot.py
# dialogue for submitting notes before submitting a shot to gladiator. Copies files to remote # location and performs validations. # -------------------------------------------------------------------------------------------------- import nuke import nukescripts import os import shutil import threading import smtplib i...
multi_web_server.py
""" 寻找地图上湖泊,路径规划 """ import threading import time import json import numpy as np import os import sys import copy root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(root_path) sys.path.append( os.path.join( os.path.dirname( os.path.abspath(__file__)), ...
hum-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)) ...
inplace_upgrade.py
#!/usr/bin/env python import json import logging import os import psutil import psycopg2 import shlex import shutil import subprocess import sys import time import yaml from collections import defaultdict from threading import Thread from multiprocessing.pool import ThreadPool logger = logging.getLogger(__name__) RS...
main.py
# !/usr/bin/env python3 # -*- coding:utf-8 -*- ''' created by Fangyang on Time:2019/10/26 ''' __author__ = 'Fangyang' from threading import Thread from dataclasses import dataclass from time import sleep @dataclass class A: a: int = 0 active: bool = False def __post_init__(self): self.thread = Th...
pool.py
from kspider.settings import ProxyPoolSettings from kspider.commen import stop_thread from kspider.http import get_response from threading import Thread import redis import warnings import time class ProxyPool(): def __init__( self, proxy_url=None, proxyPoolSettings=ProxyPoolSettings, ...
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 from electrum.bitcoin import TYPE_ADDRESS from electrum.storage import WalletStorage, StorageReadWriteError from electrum.wallet import Wall...
CustomApiClient.py
from __future__ import print_function import httplib2 from Authentication.Auth import Auth from googleapiclient.discovery import build import google.auth.exceptions import threading import time class CustomApiClient: db_breaker=None def __init__(self, data): self.data = data self.drive_servic...
server.py
import os import signal import ssl import threading from base64 import b64encode from contextlib import contextmanager from textwrap import dedent from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, Iterator from unittest.mock import Mock from werkzeug.serving import BaseWSGIServer, WSGIRequestHandler fro...
host_callback_test.py
# Copyright 2020 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
yiff_scraper.py
import sys import os import requests from bs4 import BeautifulSoup import threading import concurrent.futures from multiprocessing.pool import ThreadPool from multiprocessing import Pool # Returns the name of the file def get_file_name(URL): lst = URL.rsplit("/") name = lst[-1] return name # Returns lis...
conftest.py
# -*- coding: utf-8 -*- try: from http.server import HTTPServer from http.server import SimpleHTTPRequestHandler except ImportError: from BaseHTTPServer import HTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler import ssl import tempfile import threading import pytest from requests.com...
window.py
import os import sys import psutil import sqlite3 import pandas as pd from PyQt5 import QtCore from PyQt5 import QtWidgets from PyQt5.QtCore import Qt from PyQt5.QtGui import QPalette from multiprocessing import Queue, Process from trader import Trader from strategy import Strategy sys.path.append(os.path.dirname(os.pa...
server.py
import logging import json import signal import gevent import requests import gevent.pool from redis import StrictRedis from datetime import datetime from gevent.queue import Queue from threading import Thread from requests.exceptions import ConnectionError, Timeout from time import sleep from uptime.notifiers impor...
__init__.py
import os import sys import subprocess import threading import time import wx import wx.aui from wx import FileConfig import pcbnew from .dialog import Dialog def check_for_bom_button(): # From Miles McCoo's blog # https://kicad.mmccoo.com/2017/03/05/adding-your-own-command-buttons-to-the-pcbnew-gui/ def...
sync.py
# # Copyright (C) 2008 The Android Open Source Project # # 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 la...
variable_scope.py
# Copyright 2015 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...
test_cli.py
# Remofile - Quick and easy-to-use alternative to FTP # # This file is distributed under the MIT License. See the LICENSE file # in the root of this project for more information. # # Written by Jonathan De Wachter <dewachter.jonathan@gmail.com>, March 2018 import os import time import shutil from multiprocessing impor...
Test.py
# Copyright 2015 Ufora 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 i...
test_gui.py
from socket import * import threading from tkinter import * from tkinter.ttk import * import time measurementList = ["Current"] defaultValues = "0" * len(measurementList) IP_INFO = ('', '') # This will update after first batch of data is recieved. PORT = 3000 # If you change this change in gui.py as well. hostName...
sikuli.py
""" Created on 2015-08-19 @author: wang_yang1980@hotmail.com """ import socket import logging import sys import os import glob import time import threading import codecs try: from urllib import urlopen except ImportError: from urllib.request import urlopen try: from xmlrpclib import ProtocolError except ...
dump.py
#!/usr/bin/env python import sys import argparse import zmq import json from hexdump import hexdump from threading import Thread from cereal import log import selfdrive.messaging as messaging from selfdrive.services import service_list def run_server(socketio): socketio.run(app, host='0.0.0.0', port=4000) if __nam...
prepromote.py
import os import re import sys import shlex import json import glob import time import logging import importlib import threading import subprocess import signal import csv import argparse import Queue import traceback from subprocess import check_output from copy import deepcopy import multiprocessing try: import s...
_a4c_pre_configure_source.py
from cloudify import ctx from cloudify.exceptions import NonRecoverableError from cloudify.state import ctx_parameters as inputs import subprocess import os import re import sys import time import threading import platform from StringIO import StringIO from cloudify_rest_client import CloudifyClient from cloudify im...
__init__.py
# Copyright (c) PyZMQ Developers. # Distributed under the terms of the Modified BSD License. import sys import time from threading import Thread from unittest import TestCase try: from unittest import SkipTest except ImportError: from unittest2 import SkipTest from pytest import mark import zmq from zmq.util...
_exit_scenarios.py
# Copyright 2016 gRPC 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 agreed to in writing...
clean_vectors.py
from multiprocessing import Queue, Process from argparse import ArgumentParser from nltk.corpus import stopwords import ioutils VOCAB_FILE = "{year:d}-vocab.pkl" def worker(proc_num, queue, out_dir, train_dir, vec_suffix, lang): while True: if queue.empty(): break year = queue.get()...
actions.py
import logging import time from threading import Thread from PyQt5.QtWidgets import QPushButton, QDialog, QLabel, QLineEdit from isar.scene import audioutil, sceneutil from isar.scene.scenemodel import Scene logger = logging.getLogger("isar.events.actions") class Action: # if an action has extra properties, it...
velma_reachability_map_generate.py
#!/usr/bin/env python # Copyright (c) 2015, Robot Control and Pattern Recognition Group, # Institute of Control and Computation Engineering # Warsaw University of Technology # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the ...
ssh.py
from __future__ import absolute_import import inspect import logging import os import re import shutil import string import sys import tarfile import tempfile import threading import time import types from pwnlib import term from pwnlib.context import context from pwnlib.log import Logger from pwnlib.log import getLo...
ui_backend.py
from UI.Interface_MLP import QtWidgets, Ui_MainWindow, QtCore from PyQt5.QtCore import QEvent, Qt, QThread from PyQt5.QtWidgets import QScrollArea, QVBoxLayout, QGroupBox, QLabel, QPushButton, QHBoxLayout, QColorDialog, QSpinBox,QWidget from PyQt5 import QtGui import matplotlib.pyplot as plt from UI.external_widgets.er...
benchmark.py
# Usage: # DJANGO_SETTINGS_MODULE=tests.postgresql_settings python -m django migrate # DJANGO_SETTINGS_MODULE=tests.postgresql_settings python benchmark.py import threading import time import django from django.db import connection from sequences import get_next_value django.setup() # Reinitialize sequence get_nex...
tests.py
# Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. import copy import io import os import pickle import re import shutil import sys import tempfile import threading import time import unittest from pathlib import Path from unittest import mock, skipIf from django.conf impo...
github_updates_checker.py
import re import urllib.request import threading from ripper.constants import * class Version: @staticmethod def validate(version: str): parts = version.split('.') if len(parts) != 3: return False for ps in parts: if not ps.isdigit(): return Fal...
PyHook.py
#Author: Ilan Kalendarov, Twitter: @IKalendarov #License: BSD 3-Clause from __future__ import print_function import frida from time import sleep import psutil from threading import Lock, Thread import sys lockRunas = Lock() # Locking the run as thread lockCmd = Lock() # locking the cmd thread lockPsExec = Lock() ...
SocialFish.py
#-*- coding: utf-8 -*- # SOCIALFISH # by: Technical Dada # ########################### from time import sleep from sys import stdout, exit from os import system, path import multiprocessing from urllib import urlopen from platform import architecture from wget import download RED, WHITE, CYAN, GREEN, END = '...