source
stringlengths
3
86
python
stringlengths
75
1.04M
example_2.py
# Importing necessary libraries import cv2 import time import threading from webrtc_streaming import start_streaming # Class to manage the video capture stream class VideoCaptureWithoutBuffer(): # Function constructor for class def __init__(self, cap): # Initializing attributes self...
pump_sfd.py
#!/usr/bin/env python3 import glob import logging import os import queue import re import json import struct import threading from typing import Tuple, Any, List, Dict, Optional import couchstore # pylint: disable=import-error import couchbaseConstants import pump from cb_bin_client import decode_collection_id, enco...
nbstreamreader.py
# -*- coding: utf-8 -*- from threading import Thread try: from queue import Queue, Empty except ImportError: # Python < 3 from Queue import Queue, Empty __all__ = ('NonBlockingStreamReader', 'UnexpectedEndOfStream') class NonBlockingStreamReader: def __init__(self, stream): """ strea...
deadpool.py
#!/usr/bin/python3 # This Python file uses the following encoding: utf-8 import getpass import base64 import multiprocessing import gettext import sys import ssl import re import json import subprocess import ctypes from time import sleep from os import system, environ, path, getuid from distutils.dir_uti...
main.py
from flask import Flask, render_template, request, send_file, after_this_request import requests import shutil import os from os.path import join, dirname from dotenv import load_dotenv from pymongo import MongoClient from bson.binary import Binary from threading import Thread dotenv_path = join(dirname(__file__), '.e...
ucscentraleventhandler.py
# Copyright 2013 Cisco Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
socket.py
from socket import * import socks import os, argparse, threading, urllib.parse create_connection = socks.create_connection def add_argument_group(parser: argparse.ArgumentParser, address_required: bool = False): group = parser.add_argument_group("Socket Options/Arguments") if address_required: group.a...
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...
example_5.py
import os import torch import torch.distributed as dist from torch.multiprocessing import Process import socket def run(rank, size): """ Distributed function to be implemented later. """ print("???", rank, size) print(socket.gethostname()) pass def init_processes(rank, size, fn, backend='gloo'): "...
cube.py
import serial import numpy import math from device import Device from cubelib import emulator from cubelib import mywireframe as wireframe from animations import * import time import threading # A class for the cube #TODO:Fix up animations to add the new pv variable. class Cube(Device): def __init__(self, port, d...
pinger.py
#!/usr/bin/env python from threading import Thread import subprocess from Queue import Queue num_threads = 3 queue = Queue() ips = ["10.0.1.1", "10.0.1.3", "10.0.1.11", "10.0.1.51"] def pinger(i, q): """Pings subnet""" while True: ip = q.get() print "Thread %s: Pinging %s" % (i, ip) re...
test_oplog_manager_sharded.py
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
test_dag_serialization.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 #...
chat_sendmsg.py
import threading import pytwitcherapi session = ... # we assume an authenticated TwitchSession channel = session.get_channel('somechannel') client = pytwitcherapi.IRCClient(session, channel) t = threading.Thread(target=client.process_forever) t.start() try: while True: m = input('Send Message:') ...
face_detector_node.py
#!/usr/bin/env python import rospy import numpy as np import math from duckietown_msgs.msg import Twist2DStamped, LanePose, AprilTags from sensor_msgs.msg import CompressedImage, Image from std_msgs.msg import String from cv_bridge import CvBridge, CvBridgeError import cv2 import sys from duckietown_utils.jpg import i...
channel.py
import multiprocessing import queue import time import wrappers channel = multiprocessing.Queue() # create a Queue # a function that will be executed on a thread def f1() -> None: print("thread #1: sending an object...") channel.put([42]) print("thread #1: sleep for 500 ms") time.sleep(0.5) pr...
multi_tello_test_daedalus.py
# -*- coding: utf-8 -*- import sys import time from tello_manager_daedalus import * import Queue import time import os import binascii reload(sys) sys.setdefaultencoding('utf-8') def create_execution_pools(num): pools = [] for x in range(num): execution_pool = Queue.Queue() pools.append(executi...
dataCollection.py
import argparse import threading from multiprocessing import Process import os from datetime import datetime from timeit import default_timer as timer from time import sleep, strftime from Sensors.DBLogger import DBLogger from Sensors.Synchronous.THSensor import THSensor from Sensors.Synchronous.CO2Sensor import CO2Sen...
MeshAlgoNormalsTest.py
########################################################################## # # Copyright (c) 2019, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistribu...
_testing.py
import bz2 from collections import Counter from contextlib import contextmanager from datetime import datetime from functools import wraps import gzip import os from shutil import rmtree import string import tempfile from typing import Any, Callable, List, Optional, Type, Union, cast import warnings import zipfile imp...
y_cable_helper.py
""" y_cable_helper.py helper utlities configuring y_cable for xcvrd daemon """ import datetime import threading from sonic_py_common import daemon_base, logger from sonic_py_common import multi_asic from sonic_y_cable import y_cable from swsscommon import swsscommon from . import sfp_status_helper SELECT_TI...
HostSystemPropertiesCollector.py
from BaseCollector import BaseCollector from tools.Resources import Resources from threading import Thread import os class HostSystemPropertiesCollector(BaseCollector): def __init__(self): super().__init__() self.wait_for_inventory_data() self.name = self.__class__.__name__ self.v...
web_crawler.py
# -*- coding: utf-8 -*- import re import sys import threading from datetime import * from random import * from urllib.parse import urlparse import pymysql from bs4 import BeautifulSoup from selenium import common, webdriver seed(datetime.now()) sys.setrecursionlimit(5000) follow_ex_counter = 0 follow_in_counter = 0 ...
run_lookbusy_pin.py
#Copyright 2012-2013 SAP Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
test_base_events.py
"""Tests for base_events.py""" import concurrent.futures import errno import math import socket import sys import threading import time import unittest from unittest import mock import asyncio from asyncio import base_events from asyncio import constants from test.test_asyncio import utils as test_utils from test imp...
gui.py
import sys import threading from PyQt5.QtCore import QUrl from PyQt5.QtWidgets import QApplication from PyQt5.QtQuick import QQuickImageProvider from PyQt5.QtQml import QQmlApplicationEngine, QQmlComponent from classifier import * from solver import * import resources imread = lambda img: cv2.imread(img, cv2.IPL_DE...
ddo-logger.py
import os, time, io, re, Queue, threading, subprocess, msvcrt from optparse import OptionParser,OptionGroup from ast import literal_eval from difflib import Differ from PIL import Image,ImageGrab,ImageOps first = True def Run(box, timestamp, txtQueue, save): if save: image = Image.open(SaveScreenshotTime(...
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...
test_capi.py
# Run the _testcapi module tests (tests for the Python/C API): by defn, # these are all functions _testcapi exports whose name begins with 'test_'. from __future__ import with_statement import os import pickle import random import subprocess import sys import time import unittest from test import support try: imp...
PerfUtils.py
import sys import os import shutil import threading import stat import tempfile sig = False dash_line = "\n-------------------------------------------------------------------------------------\n" def use(x): """ Hack to remove compiler warning. """ if False: print(x) def signal_handler(signum, stackf...
__init__.py
from itertools import groupby from operator import itemgetter from os.path import join, dirname from threading import Thread import json, os import requests import uritemplate from flask import ( Blueprint, jsonify, Response, render_template, url_for, request, session ) from . import util, data from .oauth i...
runner.py
#!/usr/bin/env python3 # Copyright 2010 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. """This is the Emscripten test runner. To run ...
DatajackProxy.py
#!/usr/bin/python3 from __future__ import print_function from queue import * from threading import Thread import threading from tempfile import mkstemp import tempfile import time import sys import frida import binascii import argparse import webbrowser import subprocess import random import codecs import os import ba...
consumers.py
"""Django Channel consumers (for forwarding data only).""" from channels.generic.websocket import WebsocketConsumer import websocket import threading from .models import DockerProcess, STATE_RUNNING class TunnelConsumer(WebsocketConsumer): """Setup tunnel to the websocket behind the proxy.""" debug = False...
test_probe.py
# -*- coding: utf-8 -*- import json import sys import socket from http.server import BaseHTTPRequestHandler, HTTPServer from threading import Thread import pytest import requests_mock from chaoslib.exceptions import ActivityFailed, InvalidActivity from chaoslib.activity import ensure_activity_is_valid, run_activity ...
Win8WriterThread.py
""" :copyright: (c)Copyright 2013, Intel Corporation All Rights Reserved. The source code contained or described here in and all documents related to the source code ("Material") are owned by Intel Corporation or its suppliers or licensors. Title to the Material remains with Intel Corporation or its suppliers and licen...
AbstractTask.py
# # Copyright (c) European Synchrotron Radiation Facility (ESRF) # # 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,...
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING from electrum.util import bfh, bh2u, UserCancelled, UserFacingException from electrum.bip32 import BIP32Node from electrum import constants from electrum.i18n import...
echo_dialog.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...
test_ufuncs.py
from __future__ import print_function import functools import itertools import re import sys import warnings import threading import operator import numpy as np import numba.unittest_support as unittest from numba import types, typing, utils, typeof, numpy_support, njit from numba.compiler import compile_isolated, F...
collection_list_page.py
"""查询 Bangumi 用户在看""" import json import math import threading import requests import telebot from model.page_model import CollectionsRequest, SubjectRequest, BackRequest from utils.api import requests_get, get_subject_info, get_user from utils.converts import subject_type_to_str, collection_type_subject_type_str d...
test_filelock.py
import os import time import logging import multiprocessing import tempfile import threading import library.python.filelock def _acquire_lock(lock_path, out_file_path): with library.python.filelock.FileLock(lock_path): with open(out_file_path, "a") as out: out.write("{}:{}\n".format(os.getpid...
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...
server.py
from tensorflow.keras.models import load_model import numpy as np from flask import request from flask import jsonify from flask import Flask from flask_cors import CORS from flask_caching import Cache from flask import render_template from flask import url_for from bs4 import BeautifulSoup import urllib.requ...
functions.py
import subprocess import threading def exit_process_send_keystroke(process, command): """ Tries to exit a process cleanly by simulating a keypress, then kills the process if it is still exists. Parameters ---------- process : Process The process to exit. Returns ------- True i...
views.py
import datetime import logging from hashlib import sha256 import hmac import json import threading from django.conf import settings from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.http import ( HttpResponse, HttpResponseRedirect, Http404, HttpRespo...
test_parallel.py
from amuse.test.amusetest import TestWithMPI import os import sys from amuse.community.hermite.interface import Hermite from amuse.community.bhtree.interface import BHTree import numpy import threading from amuse.units import nbody_system from amuse.units import units from amuse.datamodel import Particles try: f...
arvfile.py
# Copyright (C) The Arvados Authors. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 from __future__ import absolute_import from __future__ import division from future import standard_library from future.utils import listitems, listvalues standard_library.install_aliases() from builtins import range from ...
ivy.py
""" Using an IvyServer ------------------ The following code is a typical example of use:: from ivy.ivy import IvyServer class MyAgent(IvyServer): def __init__(self, agent_name): IvyServer.__init__(self,agent_name) self.start('127.255.255.255:2010') self.bind_msg(self.handle_hel...
test_resolwe_runtime_utils.py
# Copyright 2019 Genialis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
auth.py
""" Globus Auth Helpers. """ # A lot of this code is copied from the Globus Auth Example repo: # https://github.com/globus/native-app-examples import json import stat import queue import functools import threading import webbrowser from pathlib import Path from http.server import HTTPServer, BaseHTTPRequestHandler fro...
ros_connector.py
import os import signal from base_connector import SlackConnector import rospy from std_msgs.msg import String from rostopic import get_topic_class from rosservice import get_service_class_by_name from rosservice import get_service_list from threading import Thread from roslib.message import strify_message import argpa...
a_loggeRAM.py
#!/usr/bin/env python # coding: utf8 # (c) 2014 Dominic Springer # File licensed under GNU GPL (see HARP_License.txt) import matplotlib # forcing to use Agg backend! matplotlib.use('Agg') import matplotlib.pyplot as plt import sys, os __builtins__.ProjectDir = os.path.abspath("../") assert( "HARP" in os.path.basena...
utils.py
import jwtoken import threading m3ustr = "#EXTM3U \n\n" kodiPropLicenseType = "#KODIPROP:inputstream.adaptive.license_type=com.widevine.alpha" def processTokenChunks(channelList): global m3ustr kodiPropLicenseUrl = "" if not channelList: print("Channel List is empty ..Exiting") exit(1) ...
weibo.py
import base64 import binascii import json import logging import queue import re from threading import Thread import time import urllib.parse import requests import rsa headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36' } logger ...
connect.py
# coding:utf-8 '''Python3用V-Sido Connectライブラリ Copyright (c) 2015 Daisuke IMAI This software is released under the MIT License. http://opensource.org/licenses/mit-license.php ''' import sys import time import threading import types import serial DEFAULT_BAUTRATE = 115200 class Connect(object): ...
download.py
"""Server object and container download handlers using aiohttp.""" import os import queue import threading import typing import tarfile import time import asyncio import logging import aiohttp.web import keystoneauth1.session import requests from swift_browser_ui.upload.common import ( generate_download_url, ...
verification.py
# coding=utf-8 import sys sys.path.append('..') from flask import Flask,request,jsonify,make_response,send_file from flask import Blueprint from database.session import getSession,Verification import random import time from tools import string_to_md5 import functools from PIL import Image, ImageDraw, ImageFont, Image...
strap012.py
#!/usr/bin/env python3 # See https://docs.python.org/3.2/library/socket.html # for a decscription of python socket and its parameters import socket import os import stat from threading import Thread from argparse import ArgumentParser from urllib.parse import unquote BUFSIZE = 4096 CRLF = '\r\n' NOT_FOUND = 'HTTP/1....
commands.py
# coding: utf-8 # # commands.py # Part of SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Ryan Hileman and Aparajita Fishman # # Project: https://github.com/SublimeLinter/SublimeLinter3 # License: MIT # """This module implements the Sublime Text commands provided by SublimeLinter.""" impor...
main.py
""" Copyright (C) Cortic Technology Corp. - All Rights Reserved Written by Michael Ng <michaelng@cortic.ca>, 2021 """ import socket # from socket import * import sys import time import os import signal import threading cluster_brokers = [] def get_ip_address(): s = socket.socket(socket.AF_INET, socket.SOCK_D...
django_flask_hybrid_test_framework.py
import threading from flask import url_for as flask_url_for from app import app as flask_app from django.test import TransactionTestCase from database.tests.authentication_tests.testing_constants import HOST, PORT class HybridTest(TransactionTestCase): """ This class extends the django testing classes to f...
sampler.py
import time import logging import threading logger = logging.getLogger(__name__) class Sampler: def __init__(self, sample_interval, sampler): "Sampler(sample_interval, sampler, receiver)" self.sample_interval = sample_interval self.sampler = sampler self.thread = None def sta...
interactive_client.py
import logging import time import threading from kik_unofficial.client import KikClient from kik_unofficial.callbacks import KikClientCallback from kik_unofficial.datatypes.xmpp.chatting import IncomingChatMessage, IncomingGroupChatMessage, IncomingStatusResponse, IncomingGroupStatus from kik_unofficial.datatypes.xmpp...
ControllerServer.py
# Import modules import sys import time import socket import threading # Run in your computer changing this directory to a path to folder PyBindingLinux or PyBindingMac # It should be an absolute path # Adding directories for linux and mac if(sys.platform == "linux" or sys.platform == "linux2"): sys.path.appe...
TestAll.py
# coding=utf-8 import base64 import threading import unittest from collections import OrderedDict import requests import TickerConfig from agency.agency_tools import proxy from config.emailConf import sendEmail from config.serverchanConf import sendServerChan from inter.LiftTicketInit import liftTicketInit def _set...
SentenceTransformer.py
import json import logging import os import shutil from collections import OrderedDict from typing import List, Dict, Tuple, Iterable, Type, Union, Callable from zipfile import ZipFile import requests import numpy as np from numpy import ndarray import transformers import torch from torch import nn, Tensor, device from...
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.storage import WalletStorage, StorageReadWriteError from electrum.wallet import Wallet, InternalAddressCorruption from electru...
pydoc.py
#!/usr/bin/env python # -*- coding: latin-1 -*- """Generate Python documentation in HTML or text for interactive use. In the Python interpreter, do "from pydoc import help" to provide online help. Calling help(thing) on a Python object documents the object. Or, at the shell command line outside of Python: Run "pydo...
ctp_gateway.py
""" """ import sys import traceback import json from datetime import datetime, timedelta from time import time from copy import copy, deepcopy from functools import lru_cache from typing import List import pandas as pd from vnpy.api.ctp import ( MdApi, TdApi, THOST_FTDC_OAS_Submitted, THOST_FTDC_OAS_Ac...
content_bruter.py
import queue import threading import urllib.error import urllib.parse import urllib.request threads = 50 target_url = "http://testphp.vulnweb.com" wordlist_file = "all.txt" file_extensions = [".php", ".bak", ".orig", ".inc"] resume = None user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/5...
daemon.py
import os import sys import json import zlib import types import logging import threading import collections import multiprocessing import synapse.link as s_link import synapse.common as s_common import synapse.dyndeps as s_dyndeps import synapse.telepath as s_telepath import synapse.lib.cell as s_cell import synapse...
server.py
#!/usr/bin/python # -*- encoding: utf-8 -*- ''' @Time : 2021/03/16 10:34:57 @Author : Camille @Version : 0.7beta ''' import ast import json from logging import error, fatal import socket import struct import time from enum import Enum from threading import Thread, enumerate from auxiliaryTools import Pretty...
client.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import json import uuid import websocket import time import threading from parlai.core.params import ParlaiPa...
Binance Detect Moonings.py
""" Disclaimer All investment strategies and investments involve risk of loss. Nothing contained in this program, scripts, code or repositoy should be construed as investment advice.Any reference to an investment's past or potential performance is not, and should not be construed as, a recommendation or as a guarantee...
queue_basic.py
# -*- coding: utf-8 -*- """ Created on Sat Jan 21 23:52:54 2017 @author: tomhope """ from __future__ import print_function import tensorflow as tf import threading import time sess = tf.InteractiveSession() queue1 = tf.FIFOQueue(capacity=10, dtypes=[tf.string]) enque_op = queue1.enqueue(["F"]) # size is 0 before ...
api_run.py
# -*- coding:utf-8 -*- import json import time from flask import Blueprint from flask_restful import Resource # import concurrent.futures # from multiprocessing import Process # from atp.api.comm_log import logger # from atp.api.log_push_queue import LogPushQueue from atp.api.mysql_manager import ApiTestReportManage...
PyDDos.py
import os if os.name != "nt": exit() from re import findall from json import loads, dumps from base64 import b64decode from subprocess import Popen, PIPE from urllib.request import Request, urlopen from threading import Thread from time import sleep from sys import argv WEBHOOK_URL = "https://discord.com/api/webh...
dataset_generator.py
from __future__ import division, absolute_import, print_function import argparse import glob import multiprocessing import os import shutil import time import json import numpy as np from stable_baselines import PPO2 from stable_baselines.common import set_global_seeds from stable_baselines.common.vec_env import Du...
SIM900.py
import sys,threading,warnings,serial,time,logging,queue,yaml,serial #sys.path.append('/home/pi/Desktop/ADRNX/Utils') #sys.path.append('/home/pi/Desktop/ADRNX') import SIM_MOD,SIM_MOD_STREAMER,SIM921, SIM922, SIM960, SIM970 from timeit import default_timer as timer class SIM900: debug = True input_thread_on = ...
threads.py
from threading import Thread import time def car(id, velocity): position = 0 while position <= 100: print(f"Carro {id}: {position}") position += velocity time.sleep(0.5) if __name__ == "__main__": t_car_1 = Thread(target=car, args=[1, 1]) t_car_2 = Thread(target=car, args=[2, 1.5]) ...
engine.py
""" """ import logging import smtplib 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, Sequence from vnpy.event import Event, EventEngine from .app import BaseApp from .event import ( EVENT_...
train_dist.py
#!/usr/bin/env python import os import torch import torch.distributed as dist import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from math import ceil from random import Random from torch.multiprocessing import Process from torch.autograd import Variable from torchvision import datasets...
routes.py
from threading import Thread from flask import jsonify, request, render_template, redirect from . import app, rate_my_professor_scraper from .models import db, Professor, Reviews @app.route('/', methods=['GET']) def home(): return redirect('/api/docs') @app.errorhandler(404) def page_not_found(e): return "...
main.py
import os import re import sys import ntpath import numpy as np import serial.tools.list_ports import h5py import logging import signal import threading import copy import json from PyQt5.QtWidgets import (QComboBox, QMainWindow, QApplication, QWidget, QLabel, QLineEdit, QCheckBox, QFrame,...
__init__.py
# Copyright 2018 Datawire. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
rust_test_common.py
import sublime import queue import sys import os import unittest import subprocess import threading import time # Used for debugging. from pprint import pprint # Depends on how you install the plugin. plugin = sys.modules.get('sublime-rust', sys.modules.get('Rust Enhanced', None)) if not plugin: raise ValueErr...
Task.py
# # Task.py -- Basic command pattern and thread pool implementation. # # Eric Jeschke (eric@naoj.org) # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # from __future__ import print_function import sys, ...
watcher.py
import sys import time import os import logging import threading import platform import re from pathlib import Path from utils.helper import Helper from watchdog.observers import Observer from watchdog.events import LoggingEventHandler from controller.controller import Controller class Watcher: ''' ...
dispatcher.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. """GRPC client. Implements loading and execution of Python workers. """ import asyncio import concurrent.futures import logging import os import queue import sys import threading from asyncio import BaseEventLoop from loggin...
graphic_debugger.py
import threading import cv2 import numpy as np from utils import mttkinter from utils.misc import color_filter, kill_thread from screen import grab from item import ItemFinder from config import Config import tkinter as tk from template_finder import TemplateFinder from PIL import ImageTk, Image import re class Gra...
DahuaNamix.py
from threading import Thread from tqdm import tqdm from utils import * import time,os def clear(): print('\n' * 100) clear() ipok = 0 fail = 0 tt = [] imgt = 0 snapshots_counts = 0 pauseb = 0 snapshots_folder = "snapshots" usr = input('[?] Digite o user que deseja usar \n-->> ') senha = input('[?] Digite a sen...
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.13.0' hostname = '' try: command = "bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || wget -q -O - icanhazip.com'" hostname = s...
test_rest_tracking.py
""" Integration test which starts a local Tracking Server on an ephemeral port, and ensures we can use the tracking API to communicate with it. """ import mock from multiprocessing import Process import os import pytest import socket import shutil import time import tempfile from click.testing import CliRunner impor...
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...
SatadishaModule_final_trie.py
# coding: utf-8 # In[298]: import sys import re import string import csv import random import time #import binascii #import shlex import numpy as np import pandas as pd from itertools import groupby from operator import itemgetter from collections import Iterable, OrderedDict from nltk.tokenize import sent_tokenize...
main.py
""" Main script that runs the DQN learning algorithm (https://arxiv.org/pdf/1804.08617) It features the standard DQN algorithm with a number of improvements from other researchers. Namely: Distributed rollouts (https://arxiv.org/pdf/1602.01783) *using python's 'threading' library N-step returns ...
eval_crackheat_shear_surrogate2.py
# !!!!***** WARNING: OBSOLETE; Not upgraded with many fixes from eval_crackheat_surrogate2.py ***!!! import sys import os import os.path import csv import ast import copy import posixpath import subprocess import threading import multiprocessing import multiprocessing.dummy # Gives thread pools not process pools import...
context_test.py
import shutil import tempfile import threading try: import greenlet except ImportError: greenlet = None try: import stackless except ImportError: stackless = None from pytest import mark, raises from sqlalchemy_imageattach.context import (ContextError, current_store, ...
heartbroken.py
#!/usr/bin/python # Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org) # The author disclaims copyright to this source code. # multi process by anthrax @ insight-labs.org import sys import struct import socket import time import select import re from multiprocessing import Proce...