source
stringlengths
3
86
python
stringlengths
75
1.04M
locators.py
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2015 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import gzip from io import BytesIO import json import logging import os import posixpath import re try: import threading except Impo...
dispatcher.py
"""GRPC client. Implements loading and execution of Python workers. """ import asyncio import concurrent.futures import logging import queue import threading import traceback import os import grpc import pkg_resources from . import bindings from . import functions from . import loader from . import protos from .lo...
ssh_attack.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # -*- coding: gbk -*- # Date: 2019/2/12 # Created by 冰河 # Description 暴力破解SSH # 用法: python ssh_attack.py -H 192.168.175.131 -u root -F ssh_password.txt # 博客 https://blog.csdn.net/l1028386804 from pexpect import pxssh import optparse import time from threading i...
minimizer.py
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
views.py
from django.shortcuts import render, redirect from StudentManager.functions import viewStudents from StudentManager.models import Students, Allowed, CurrentSeason, Seasons, CheckIn import concurrent.futures import threading from django.utils import timezone import datetime from Manager.functions import incrementTotalCh...
run.py
import contextlib import json import logging import os import re import shlex import signal import subprocess import sys from importlib import import_module from multiprocessing import get_context from multiprocessing.context import SpawnProcess from pathlib import Path from typing import TYPE_CHECKING, Any, Callable, ...
outputvideo.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ This file contains the classes used to send videostreams to Twitch """ from __future__ import print_function, division import numpy as np import subprocess import signal import threading import sys try: import Queue as queue except ImportError: import queue import ...
tracking.py
import cv2 from multiprocessing import Process, Pool from env import * def updateTracker(trackers, frame): for t in trackers: track, bbox = t.update(frame) if track: p1 = (int(bbox[0]), int(bbox[1])) p2 = (int(bbox[0]) + int(bbox[2]), int(bbox[1]) + int(bbox[3])) ...
old.py
# Copy of http://stackoverflow.com/a/20104705 # from threading import Thread from flask import Flask, Blueprint, request, Response, render_template, jsonify from flask_restplus import Api, Resource, apidoc, fields from flask_bootstrap import Bootstrap, WebCDN from flask_socketio import SocketIO, send import os # import...
register_bones.py
""" Batch registers/unregisters OP bones in MMD. Usage: Set FRAME_FIRST and FRAME_FINAL respectively to the start and end of frames that you want to edit. When FRAME_FIRST is greater than FRAME_FINAL, frame operations will be done from right to left. You would also need to modify those mouse-clicking coordinates in ...
__init__.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ .. module:: __init__ :platform: Unix :synopsis: the top-level module of Dragonfire that contains the entry point and handles built-in commands. .. moduleauthor:: Mehmet Mert Yıldıran <mert.yildiran@bil.omu.edu.tr> """ import argparse # Parser for command-line o...
test_wsgiref.py
from unittest import mock from test import support from test.test_httpservers import NoLogRequestHandler from unittest import TestCase from wsgiref.util import setup_testing_defaults from wsgiref.headers import Headers from wsgiref.handlers import BaseHandler, BaseCGIHandler, SimpleHandler from wsgiref import util from...
test_async_subprocess.py
import os import socket import threading import time import sys from future import standard_library from future.utils import PY3 with standard_library.hooks(): import http.server import socketserver import pytest import tornado.testing from past import autotranslate autotranslate(['pkipplib']) from pkipplib i...
open_ended_generalist.py
# Copyright 2021 Davide Paglieri # 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...
bundle_manager.py
import copy import datetime import logging import os import random import re import sys import threading import time import traceback from codalab.objects.permission import check_bundles_have_read_permission from codalab.common import NotFoundError, PermissionError from codalab.lib import bundle_util, formatting, path...
Process.py
from multiprocessing import Process from os import getpid from random import random from time import time, sleep def download_task(filename): print("Start the thread[%d]." %getpid()) print("Downloading %s..." %filename) time_to_download = random() * 10 sleep(time_to_download) print("%s Downloaded a...
slack.py
import json import logging import random import re import requests import sys import time import traceback from websocket import WebSocketConnectionClosedException from markdownify import MarkdownConverter from will import settings from .base import IOBackend from will.utils import Bunch, UNSURE_REPLIES, clean_for_pi...
download_images.py
import requests import numpy as np import os import shutil import re import threading import time import sqlite3 def download(*h): def add_error(id_): sql = '''UPDATE urls SET error = 1 WHERE id = ?;''' update_status(sql, id_) def add_download(id_): sql = '''UPDATE urls SET download = ...
MotifSuiteImpl.py
# -*- coding: utf-8 -*- #BEGIN_HEADER import logging import os import uuid from multiprocessing import Process from installed_clients.KBaseReportClient import KBaseReport from installed_clients.MotifFindermfmdClient import MotifFindermfmd from installed_clients.MotifFinderHomerClient import MotifFinderHomer from instal...
runtests.py
#!/usr/bin/env python # vim:ts=4:sw=4:et: from __future__ import absolute_import from __future__ import division from __future__ import print_function # no unicode literals import os import os.path # in the FB internal test infra, ensure that we are running from the # dir that houses this script rather than some othe...
example_test.py
import re import os import struct import socket from threading import Thread import ssl from tiny_test_fw import DUT import ttfw_idf import random import subprocess try: import BaseHTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler except ImportError: import http.server as BaseHTTPServer ...
NCS_SegmentationApp.py
# This script is based off SegmentationApp.py. Modified to perform inference on NCS from PIL import Image from PIL import ImageTk import tkinter as tk from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg import threading import material_segmentation.plotting_utils as utils from ncs_demos import ncs_segment ...
controller.py
from functools import wraps import threading import time import datetime import logging from typing import Optional, Iterable, Dict, List from collections import OrderedDict import binsync.data from ..client import Client from ..data import User, Function, StackVariable, Comment, Struct _l = logging.getLogger(name=__...
render_all.py
import os import subprocess import tempfile import shutil from threading import Thread from PIL import Image, ImageDraw, ImageFont from lattice import RESOLUTIONS ASSETS_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'assets') episodes = [ ["text", "Quantum mechanics explained\nusing an actual...
SpotifyLyric.pyw
from PyQt5 import QtCore, QtGui, QtWidgets import backend import time import threading import os import re import subprocess if os.name == "nt": import ctypes ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID("spotifylyrics.version1") class Communicate(QtCore.QObject): signal = QtCore.pyqtSig...
hello_world.py
import logging import threading import time from pylinkjs.PyLinkJS import run_pylinkjs_app, Code, get_broadcast_jsclients def ready(jsc, *args): """ called when a webpage creates a new connection the first time on load """ print('Ready', args) def reconnect(jsc, *args): """ called when a webpage automat...
paho_mqtt_client.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import asyncio import threading import functools import paho.mqtt.client as mqtt_client from .mqtt_base import MQTTBase import logging logger = logging.getLogger(__name__) class PahoMQTTClient(MQTTBase): CONNECTION_RESULT_CODES = { 0: "Connection successful"...
main.py
# Import Required Library from tkinter import * import datetime import time # import winsound from threading import * # Create Object root = Tk() # Set geometry of the gui root.geometry("400x200") # Use Threading def Threading(): t1=Thread(target=alarm) t1.start() def alarm(): # Infinite Loop while True: # Se...
test_quell_uprising_subsystem.py
from pydantic import BaseModel from queue import Queue from threading import Thread from typing import List from ..scrap_worker.app_state_machine import ( ScrapWorkerSubsystemConfigurations, ) from ..scrap_worker.state_machine.models import StateFlag, TimeoutFlag from ..scrap_worker.models.event_models import Cand...
rtu_slave.py
#!/usr/bin/env python ''' Pymodbus Asynchronous Server Example -------------------------------------------------------------------------- The asynchronous server is a high performance implementation using the twisted library as its backend. This allows it to scale to many thousands of nodes which can be helpful for ...
verify.py
#!/usr/bin/python3 import sys,io,time,pgbar,threading,queue def w_y(c): for i in range(c): yield i+1 def wq_put(): global wg,wq e.clear() while not wq.full(): try: g=next(wg) except: e.set() wfunc() wq.put(g) e.set() wfunc() def bar(): global n,allc while True: if n >= allc: pgbar.ba...
desc_trpo_gae_roboschool_HopperV1.py
# -*- coding:utf8 -*- # File : desc_trpo_gae_box2d_RoboschoolHopperV1.py # Author : Jiayuan Mao # Email : maojiayuan@gmail.com # Date : 12/08/2017 # # This file is part of TensorArtist. import os import threading import roboschool import numpy as np from tartist.app import rl from tartist.core import get_env, ...
backendCamera.py
from datetime import datetime from picamera import PiCamera from pathlib import Path from threading import Lock, Thread from backendTimerUtils import IndefiniteTimer from backendJSONUtil import appendtoJSON from time import sleep class Camera(PiCamera): def __init__(self, everyN): super(Camera, self).__init__() ...
random-test.py
#!/usr/bin/env python import pika import sys import time import subprocess import random import threading import requests import json import signal import datetime from command_args import get_args, get_mandatory_arg, get_optional_arg, is_true, get_optional_arg_validated from RabbitPublisher import RabbitPublisher fro...
daemons.py
# Copyright (c) 2019 Cable Television Laboratories, 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 ...
Thread.py
import threading import time def print1(): print("1") time.sleep(1) return print1() def print2(): print("2") time.sleep(1) return print2() def main(): threading.Thread(target=print1).start() threading.Thread(target=print2).start() if __name__ == "__main__": main()
session.py
import os import platform import queue import threading import time from datetime import datetime from enum import Enum, auto from typing import Callable from typing import Optional, Dict import warnings import ray from ray.train.constants import ( DETAILED_AUTOFILLED_KEYS, TIME_THIS_ITER_S, PID, TIMESTAMP, TIME_T...
readers.py
""" This module reads and iterates over data, making it available for training. """ from __future__ import division import abc import threading import numpy as np try: import pandas as pd except ImportError: # No pandas; we can't read HDF5 files. pd = None import six import theano from ..util import misc...
runner.py
#!/usr/bin/env python2 # This Python file uses the following encoding: utf-8 ''' Simple test runner These tests can be run in parallel using nose, for example nosetests --processes=4 -v -s tests/runner.py will use 4 processes. To install nose do something like |pip install nose| or |sudo apt-get install python-no...
portable_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...
timeout.py
from threading import Thread def timeout(delay, call, *args, **kwargs): """Run a function call for `delay` seconds, and raise a RuntimeError if the operation didn't complete.""" return_value = None def target(): nonlocal return_value return_value = call(*args, **kwargs) t = Threa...
tcr.py
# -*- coding: utf-8 -*- print("You can generate token Here") print("http://101.255.95.249:6969") print("CREATED BY TCR AND FIXED BY RIOBITHUB") import SOURCE from SOURCE.libapi.ttypes import * from datetime import datetime import time,random,sys,json,codecs,threading,glob,re cl = SOURCE.LINE() #cl.login(qr=False) cl...
test_proxies.py
''' Date: 3/15/2019 Author: @Diss.Security Description: Reads a file that contains a list of proxies and determines whether or not that list is good. Each line in the file must be in the format of ip:port ''' import platform from os import system from time import sleep from requests import Session from th...
manager.py
"""Entry point for client creation. ``build_client_manager`` in particular is the abstraction that should be used to create a ``ClientManager``, that in return can create Pulsar clients for specific actions. """ import functools import threading from typing import Any, Dict, Type from logging import getLogger from o...
framework_test.py
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
manager.py
import logging import threading import time import traceback from concurrent.futures.thread import ThreadPoolExecutor from dataclasses import dataclass from pathlib import Path from typing import Any, Callable, Dict, Iterator, List, Optional, Set, Tuple from blspy import G1Element from chiapos import DiskProver from ...
contextmanager_test.py
import threading from contextlib import contextmanager # Thread-local state to stored information on locks already acquired _local = threading.local() @contextmanager def acquire(*locks): # Sort locks by object identifier locks = sorted(locks, key=lambda x: id(x)) # print(locks) # Make sure lock orde...
agent_client.py
# Copyright 2020 TestProject (https://testproject.io) # # 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 ...
launch.py
#!/usr/bin/env python # Copyright (c) 2013 Matt Hodges (http://matthodges.com) # 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 #...
lazy.py
import contextvars import copy import functools import importlib import importlib.machinery # pylint: disable=no-name-in-module,import-error import importlib.util # pylint: disable=no-name-in-module,import-error import inspect import logging import os import re import sys import tempfile import threading import time ...
single_robot_mobile_circle.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # ## # @brief [py example gripper] gripper test for doosan robot # @author Jin Hyuk Gong (jinhyuk.gong@doosan.com) import rospy import os import threading, time import sys import random from geometry_msgs.msg import Twist sys.dont_write_bytecode = True sys.path.ap...
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 - ...
bitfinex_websocket_multi.py
import websocket import requests import hashlib import hmac import json import time import os from threading import Thread # GLOBAL VARIABLES channels = {0: 'Bitfinex'} symbols = [] tickers = {} # [market][bid/ask] candles = {} # [market][candle1,candle2...] def update_tickers(data): global tickers sym ...
03_response_surfaces.py
import autograd.numpy as np from autograd import elementwise_grad as egrad import matplotlib.pyplot as plt from functools import partial import GPy from pyhmc import hmc from queue import Queue from threading import Thread import timeit from athena.active import ActiveSubspaces from athena.utils import Normalizer f...
old_cli_code.py
from os import environ from call_listener import * from call_maker import * from multiprocessing import Process, Pipe import subprocess # This part is a testing ground for processes and pipes def process_test(pipe: Pipe): msg = pipe.recv() print(msg) print("Exiting child process.") p1, p2 = Pipe() child...
webserver.py
from flask import Flask from flask import render_template, url_for, request, flash, redirect import sqlite3 import transferserver import chatserver import _thread import threading import multiprocessing app = Flask(__name__) app.secret_key = "supersecretkey" all_processes = [] def createTableData()...
loop.py
import requests import threading from pathlib import Path from random import choice from signal import signal, SIGINT from streamer import stream # type: ignore from ydl import ydl from settings import settings def exit_signal(signal, frame): """ Handler function used to exit the playloop. """ global interru...
test_read_parsers.py
# This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) 2013-2015, Michigan State University. # Copyright (C) 2015-2016, The Regents of the University of California. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
data_set.py
""" Created on Jul 8, 2019 @author: skwok """ import os import sys import threading import time import glob import pandas as pd from keckdrpframework.models.event import Event from keckdrpframework.models.arguments import Arguments import astropy.io.fits as pf from astropy.utils.exceptions import AstropyWarning impor...
main.py
# opensimplex from ledcd import CubeDrawer as cd from noise_terrain import NoiseTerrain, TreeObj from math import sin, cos import time import threading from random import random X_OFFSET_SPEED = 0.1 Z_OFFSET_SPEED = 0.13 drawer = cd.get_obj() drawer.translate(0, 16, 0) drawer.set_brigthness(0.5) terrain = NoiseTerra...
heartbeat.py
'''\ Class Heartbeat: - heartbeat between nats client and nats server Attributes: - pings: ping request received; - pongs: pongs or callbacks of client; - pings_outstanding: outstanding pings waiting for response - pongs_received: pong reponse received; - conn: connection between nats client an...
state_machine.py
#!/usr/bin/env python ''' Github: YaBoyWonder License: https://github.com/YaBoyWonder/Racecar/blob/master/LICENSE ''' import os from enum import Enum from threading import Thread import rospy from ar_track_alvar_msgs.msg import AlvarMarkers from std_msgs.msg import Bool from constants import * from drive import Dr...
Console.py
import sys import argparse from tools.refinery import refinery from tools.gui import GUI import threading class Console: def __init__(self): self.parser = parser = argparse.ArgumentParser() self.parser.add_argument('-s',"--source", help="archivo de entrada .csv") self.parser.add_argument("-o...
choose_tools.py
import threading import time import npyscreen from vent.api.actions import Action from vent.api.menu_helpers import MenuHelper from vent.helpers.meta import Tools class ChooseToolsForm(npyscreen.ActionForm): """ For picking which tools to add """ tools_tc = {} def repo_tools(self, branch): """ ...
data_utils.py
# Lint as python3 # 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 r...
road_speed_limiter.py
import json import select import threading import time import socket import fcntl import struct from threading import Thread from cereal import messaging from common.params import Params from common.numpy_fast import interp from common.realtime import sec_since_boot from selfdrive.kegman_kans_conf import kegman_kans_co...
Software.py
from threading import Thread, Timer, Event from package_control import events from queue import Queue import webbrowser import os import json import sublime_plugin import sublime from datetime import * from .lib.SoftwareHttp import * from .lib.SoftwareUtil import * from .lib.SoftwareRepo import * from .lib.SoftwareOffl...
virtualboard.py
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # ## ############################################################# # virtualboard.py # # Author: # Licence: MIT # Date: # # ## ############################################################# # Future imports (Python 2.7 compatibility) from __future__ import absolute_import ...
test_time.py
from test import support import decimal import enum import locale import math import platform import sys import sysconfig import time import threading import unittest import warnings try: import _testcapi except ImportError: _testcapi = None # Max year is only limited by the size of C int. SIZEOF_INT = syscon...
camera.py
# -*- coding: utf-8 -*- """ Created on Thu Nov 8 09:55:18 2018 @author: nigett """ import time from queue import Queue from threading import Thread import cv2 from logger import * class Camera: def __init__(self, path=0): self.path = path self.camera = cv2.VideoCapture(path) self.queue...
VOCDataset.py
# ---------------------------------------- # Written by Yude Wang # ---------------------------------------- from __future__ import print_function, division import os import torch import pandas as pd import cv2 import multiprocessing from PIL import Image import numpy as np from torch.utils.data import Dataset from li...
asdad.py
__author__ = 'Aaron Yang' __email__ = 'byang971@usc.edu' __date__ = '8/3/2020 11:31 PM' import threading import time def Write(): for i in range(30): print('cooking %d times'%(i+1)) # time.sleep(1) # 程序运行到这里休眠一秒,方便观察 def Sing(): for i in range(300): print('eating %d times'%(i+1)) ...
threading_condition_0408.py
# -*- coding: utf-8 -*- # @version : Python3.6 # @Time : 2017/4/8 16:45 # @Author : Jianyang-Hu # @contact : jianyang1993@163.com # @File : threading_condition_0408.py # @Software: PyCharm """ Python提供的Condition对象提供了对复杂线程同步问题的支持。Condition被称为条件变量, 除了提供与Lock类似的acquire和release方法外,还提供了wait和notify方法。 线程首先...
docstore.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import Queue import threading import logging from datetime import datetime from whoosh import index from whoosh import writing from whoosh.fields import Schema, STORED, NGRAM, TEXT, DATETIME, ID from whoosh.qparser import QueryParser from whoosh.analysis import ...
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 collections import OrderedDict import os import pickle import random import re import subprocess import sys import sysconfig import textwrap import threading import ...
parallel.py
#!/usr/bin/env python from Bio import SeqIO from threading import Thread from glob import glob from itsxcmd import ITSxCommandLine from itsx import make_path, BinPacker import os import shutil __author__ = 'mike knowles' class ITSx(object): def __init__(self, i, o, cpu, **kwargs): from Queue import Queue...
common.py
import inspect import json import os import random import subprocess import ssl import time import requests import ast import paramiko import rancher import pytest from urllib.parse import urlparse from rancher import ApiError from lib.aws import AmazonWebServices from copy import deepcopy from threading import Lock fr...
ellie_head_monitor.py
# Copyright 2021 by Dong Trung Son, Nueremberg University. # Email: trungsondo68839@th-nuernberg.de # All rights reserved. # This file is part of the Ellie-Project, # and is released under the "MIT License Agreement". Please see the LICENSE # file that should have been included as part of this package. import os import...
main.py
# -*- coding: utf-8 -*- import argparse import logging import os import socket import sys import threading from six import PY2 from six import iteritems from smart_qq_bot.config import COOKIE_FILE from smart_qq_bot.logger import logger from smart_qq_bot.app import bot, plugin_manager from smart_qq_bot.handler import ...
ircme.py
#! /usr/bin/env python3 import os import time import yaml import sys import logging import arrow from threading import Thread import importlib import ssl import irc.client import schedule from ipdb import set_trace logging.basicConfig() logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) class IRCme...
test_run.py
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import os import subprocess import tempfile import threading from contextlib import contextmanager from unittest impo...
main.py
#Packet sniffer in python for Linux #Sniffs only incoming TCP packet import socket, sys from struct import * import time from threading import Thread import curses from curses import wrapper class PacketManager(object): """docstring for PacketManager""" def __init__(self): super(PacketManager, self).__init__() ...
meauriga.py
import serial import sys,time,math,random import signal from time import ctime,sleep import glob,struct from multiprocessing import Process,Manager,Array import threading class mSerial(): ser = None def __init__(self): print self def start(self, port='/dev/ttyAMA0'): self.ser = serial.Seri...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
console_menu.py
from __future__ import print_function import platform import threading import textwrap import os from consolemenu.menu_formatter import MenuFormatBuilder from consolemenu.screen import Screen class ConsoleMenu(object): """ A class that displays a menu and allows the user to select an option. Args: ...
server.py
import threading import socket host = 'localhost' port = 3001 server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind((host,port)) server.listen() clientes = [] nicknames = [] def broadcast(mensagem): for cliente in clientes: cliente.send(mensagem) def handle(cliente): while True: ...
main.py
#!/usr/bin/env python3 # import libraries import datetime import json import math import praw import prawcore import random import requests import string import time from multiprocessing import Process, Lock from sklearn.feature_extraction.text import TfidfVectorizer from unidecode import unidecode # import additiona...
main_text-genesis.py
# -*- coding: utf-8 -*- import time from project.zone_model_1.CALCS.FurnaceModel import * from project.zone_model_1.CTS.CTS import write_list_to_csv as write_data from project.zone_model_1.CTS.CTS import PlotScatter2D from project.zone_model_1.CTS.CTS import list_all_files_with_suffix import re import os import multipr...
driller.py
import os import re import time import shutil import logging import tarfile import pathlib import tempfile import webbrowser import threading from contextlib import suppress from . import utils from . import engines from . import messages from . import decoders from . import adb_conn logger = logging.getLogger(__name_...
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...
NXcrypt.py
#!/usr/bin/python2 #! coding : utf-8 """ Usage : # encrypt a python file sudo ./nxcrypt.py --file=file_to_encrypt.py sudo ./nxcrypt.py --file=file_to_encrypt.py --output=output_file.py # inject a malicious python file into a normal python file sudo ./nxcrypt --file=normal_file.py --backdoor-file=msf_listener.py -...
gui.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
experiment.py
''' Experiment class containing all information about the current setup of experiment. Lists of liquids (Experiment.liq) and solids (Experiment.sol). Allowed ranges of quantities for every component in a dict (Experiment.rng) ''' from bayes_opt import DiscreteBayesianOptimization, UtilityFunction from kuka_parser impor...
run_arm_ai.py
# coding: utf-8 # アーム動作 import time import logging import threading import sys from lib import ARM from lib import AI from lib import SPI from lib import LED # ログ設定 logging.basicConfig(level=logging.DEBUG, format='[%(levelname)s] time:%(created).8f pid:%(process)d pn:%(processName)-10s tid:%(threa...
app.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import sys import yaml from multiprocessing import Process, Manager try: from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer except ImportError: from http.server import BaseHTTPRequestHandler, HTTPServer """ Prometheus demo exporter """ ...
eventEngine.py
# encoding: UTF-8 # 系统模块 from queue import Queue, Empty from threading import Thread from time import sleep from collections import defaultdict # 第三方模块 from PyQt4.QtCore import QTimer # 自己开发的模块 from eventType import * ######################################################################## class Ev...
imap.py
# -*- coding: utf-8 -*- """ Display number of unread messages from IMAP account. Configuration parameters: allow_urgent: display urgency on unread messages (default False) auth_scope: scope to use with OAuth2 (default 'https://mail.google.com/') auth_token: path to where the pickled access/refresh token wi...
s3op.py
from __future__ import print_function import time import math import string import sys import os import traceback from hashlib import sha1 from tempfile import NamedTemporaryFile from multiprocessing import Process, Queue from collections import namedtuple from itertools import starmap, chain, islice try: # pytho...
OSRBoxDriver.py
#!/usr/bin/env python import OSRBoxWrapper import serial.tools.list_ports import keyboard import threading import time import os import yaml class OSRBoxDriver: nb_keys = 5 ''' Class Constructor. Initializes a few important variables, such as COM port, baudrate and emulated keys. ''' ...
ik_annotate.py
#!/usr/bin/python2.7 from visual import * #import the visual module import code import numpy as np from scaledimage import * import itertools import math import sympy as sp import random from sympy.utilities.codegen import codegen #from autodiff import function, gradient import iksolver import os from oni_video import ...