source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
ib_gateway.py | """
IB Symbol Rules
SPY-USD-STK SMART
EUR-USD-CASH IDEALPRO
XAUUSD-USD-CMDTY SMART
ES-202002-USD-FUT GLOBEX
"""
from copy import copy
from datetime import datetime
from queue import Empty
from threading import Thread, Condition
from typing import Optional
import shelve
from tzlocal import get_localzone
from ib... |
__init__.py | import copy
import datetime
import json
import logging
import random
import re
import time
from threading import Thread
from platypush.config import Config
from platypush.context import get_plugin
from platypush.message import Message
from platypush.message.response import Response
from platypush.utils import get_has... |
vk_music.py | # -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
from collections import Counter
import os
import json
import Queue
import threading
import traceback
from six.moves import input as read_input
from six.moves import urllib
from .utils import prnt, replace_chars
from .exceptions import *
f... |
session.py | from slixmpp import ClientXMPP
from slixmpp.exceptions import IqError, IqTimeout
from slixmpp.xmlstream.asyncio import asyncio
from threading import Thread
from chat.menu import menu
from utils import getNeighbours, getAlgorithm, generateLSP
from graph import Graph, shortest_path
import pickle
import logging
import sys... |
thread_pool.py | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
# File : thread_pool.py
# Time :2020/8/19 15:09
# Author :Rodney Cheung
"""
import contextlib
import queue
import threading
StopEvent = object()
class ThreadPool(object):
def __init__(self, max_num, max_task_num=None):
if max_task_num:
... |
omnibus_test.py | import io
import multiprocessing as mp
import sys
import time
import pytest
from omnibus import Sender, Receiver, Message, server
from omnibus.omnibus import OmnibusCommunicator
class TestOmnibus:
@pytest.fixture(autouse=True, scope="class")
def server(self):
# start server
ctx = mp.get_cont... |
txsclient.py | # -*- coding: utf-8 -*-
# $Id: txsclient.py 70660 2018-01-21 16:18:58Z vboxsync $
# pylint: disable=C0302
"""
Test eXecution Service Client.
"""
__copyright__ = \
"""
Copyright (C) 2010-2017 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This... |
manager.py | #!/usr/bin/env python3.7
import os
import time
import sys
import fcntl
import errno
import signal
import subprocess
import datetime
from selfdrive.dragonpilot.dragonconf import dragonpilot_set_params
from common.basedir import BASEDIR
sys.path.append(os.path.join(BASEDIR, "pyextra"))
os.environ['BASEDIR'] = BASEDIR
T... |
server.py | #!/usr/bin/env python3
"""Server for multithreaded (asynchronous) chat application."""
from socket import AF_INET, socket, SOCK_STREAM
from threading import Thread
def accept_incoming_connections():
"""Sets up handling for incoming clients."""
while True:
client, client_address = SERVER.accept()
... |
peer.py | # peer.py - CS 60 Spring 2021
# Final Project - George McNulty, Karimi Itani, Boxian Wang, Gabe Kotsonis
# May 25th, 2021
#
# This progam creates the class Peer, which is a client side program using UDP that helps implement the p2p aspect
# of the larger blockchain project. It interacts with the tracker which help... |
main.py | #!/usr/bin/env python3
import logging
import threading
def start_showdown(**kwargs):
try:
import subprocess
print("Starting local Showdown server")
subprocess.run(["node", "Pokemon-Showdown/pokemon-showdown"])
except FileNotFoundError:
pass
import src.geniusect.... |
relay_integration.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... |
train_ac_f18.py | """
Original code from John Schulman for CS294 Deep Reinforcement Learning Spring 2017
Adapted for CS294-112 Fall 2017 by Abhishek Gupta and Joshua Achiam
Adapted for CS294-112 Fall 2018 by Soroush Nasiriany, Sid Reddy, and Greg Kahn
"""
import numpy as np
import tensorflow as tf
import gym
import logz
import os
import... |
__init__.py | import re
import argparse
from abc import ABCMeta, abstractmethod
from ..gateware.clockgen import *
__all__ = ["GlasgowAppletError", "GlasgowApplet", "GlasgowAppletTool"]
class GlasgowAppletError(Exception):
"""An exception raised when an applet encounters an error."""
class GlasgowAppletMeta(ABCMeta):
a... |
test.py | import rospy
from sensor_msgs.msg import PointCloud2
from visualization_msgs.msg import MarkerArray
from visualization_msgs.msg import Marker
import tf
import numpy as np
#自定义pointcloud包
import pointclouds
#from pcl import PointCloud
#自定义
import voxelgrid
import pcl
from autolab_core import YamlConfig
from dexnet.gra... |
userInterface.py | import sqlite3
import threading
import time
import tkinter as tk
from tkinter import INSERT
from tkinter import Menu
from tkinter import messagebox as msg
from tkinter import ttk
from tkinter import END
from tkinter import scrolledtext
import cv2
from PIL import ImageTk, Image
from tensorflow.keras.models i... |
sparklet.py | import fire
import logging
import os
import tempfile
import yaml
from datetime import datetime
from animate import Animator, play_by_id, clear_display
from animation import Animation
from ble_device import BleDevice
from multiprocessing import Process, Queue
from protocol import EPXProtocol, EPXCommand, ProtocolFo... |
nanny.py | from __future__ import print_function, division, absolute_import
from datetime import timedelta
import logging
from multiprocessing.queues import Empty
import os
import psutil
import shutil
import threading
from tornado import gen
from tornado.ioloop import IOLoop, TimeoutError
from tornado.locks import Event
from .... |
planningclient.py | # -*- coding: utf-8 -*-
# Copyright (C) 2012-2016 MUJIN Inc
"""
Planning client
"""
# System imports
import threading
import weakref
import os
import time
# Mujin imports
from . import APIServerError, GetMonotonicTime
from . import controllerclientbase, zmqclient
from . import zmq
# Logging
import logging
log = logg... |
mtping3.py | import subprocess
import threading
class Ping:
def __init__(self, host):
self.host = host
def __call__(self):
result = subprocess.run(
'ping -c2 %s &> /dev/null' % self.host,
shell=True
)
if result.returncode == 0:
print('%s:up' % self.host)
... |
sensor.py | #!/usr/bin/env python
"""
Copyright (c) 2014-2020 Maltrail developers (https://github.com/stamparm/maltrail/)
See the file 'LICENSE' for copying permission
"""
from __future__ import print_function # Requires: Python >= 2.6
import sys
sys.dont_write_bytecode = True
import cProfile
import inspect
import math
impor... |
pcc.py | import time
import tkinter
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.co... |
test_concurrency.py | import multiprocessing
import pandas as pd
from dask import dataframe as dd
from rubicon.domain.utils import uuid
def _log_all_to_experiment(experiment):
ddf = dd.from_pandas(pd.DataFrame([0, 1], columns=["a"]), npartitions=1)
for _ in range(0, 4):
experiment.log_metric(uuid.uuid4(), 0)
exp... |
sh.py | """
http://amoffat.github.io/sh/
"""
# ===============================================================================
# Copyright (C) 2011-2020 by Andrew Moffat
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to de... |
v0.1.py | from random_user_agent.user_agent import UserAgent
import threading
import random
import logging
import socket
import socks
import sys
import ssl
logging.basicConfig(
format="[%(asctime)s] %(message)s",
datefmt="%H:%m:%S",
level=logging.INFO
)
active_threads = 0
max_threads = 777
usera = UserAgent()
proxy_list = ... |
tcp_replay.py | from time import time
import threading
from scapy.all import *
from .Client import Client, NetAttrs
from .arp_poison import arp_poison
FIN = 0x01
SYN = 0x02
PSH = 0x08
ACK = 0x10
URG = 0x20
ECE = 0x40
CWR = 0x80
backlog_queue = []
lock = threading.Lock()
running = True
def replay_usage(exit_num=None):
usg = ""
... |
imagenet.py | from . import lmdb_datasets
from torchvision import datasets, transforms
import os
import os.path as osp
import torch.utils.data
import numpy as np
import cv2
from . import lmdb_data_pb2 as pb2
import Queue
import time
import multiprocessing
DATASET_SIZE = 100
mean = np.array([[[0.485]], [[0.456]], [[0.406]]]) * 255
s... |
miniterm.py | #!/usr/bin/env python
# Edited by Pedro Sidra <pedrosidra0@gmail.com> for use in personal project
# Very simple serial terminal
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C)2002-2020 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import a... |
Kinect-based_gait_data_acquisition_system.py | '''The MIT License (MIT)
Copyright (c) Microsoft
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, d... |
authorization.py | import cv2
import os
import sys
import pickle
import face_recognition
from threading import Thread
from smartmirror.Logger import Logger
PATH = os.path.dirname(os.path.realpath(__file__))
if sys.platform != 'linux':
PATH = PATH.replace("\\", '/')
"""
Authorization Class
- authorization is based on face r... |
test_tensorflow2_autolog.py | # pep8: disable=E501
import collections
import pytest
import sys
import pickle
from packaging.version import Version
import numpy as np
import pandas as pd
import tensorflow as tf
from tensorflow.keras import layers
import mlflow
import mlflow.tensorflow
from mlflow.tensorflow._autolog import _TensorBoard, __MLflowT... |
keylog.pyw | #first import all necessary packages
from pynput.keyboard import Key, Listener
import os
import shutil
import datetime
import winshell
from win32com.client import Dispatch
import tempfile
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MI... |
main.py | # ============================================================================================
# MIT License
# Copyright (c) 2020 Konstantinos Bourantas
# 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 th... |
test_dbus.py | #!/usr/bin/python
# Copyright 2020 Northern.tech AS
#
# 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 ap... |
colab_servertest.py | from socket import *
import sys
import threading
import time
from time import localtime
import imp
HOST = '127.0.0.1'
PORT = 1234 # 设置侦听端口
BUFSIZ = 1024
if sys.version[0] == '2':
imp.reload(sys)
sys.setdefaultencoding("utf-8")
class TcpServer():
def __init__(self):
self.ADDR = (HOST, PORT)
... |
test_data.py | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Tests for coverage.data"""
import glob
import os
import os.path
import re
import sqlite3
import threading
from unittest import mock
import pytest
from coverag... |
ic4vc_webserver.py | '''
Created on Oct 18, 2011
@author: IslamM
'''
from threading import Thread
import web, os
from web.wsgiserver import CherryPyWSGIServer
from suds.sudsobject import Object as SudsObject
from logging import getLogger
log = getLogger(__name__)
from util import catalog
from util.config import config
i... |
ps5.py | # 6.0001/6.00 Problem Set 5 - RSS Feed Filter
# Name:
# Collaborators:
# Time:
import feedparser
import string
import time
import threading
from project_util import translate_html
from mtTkinter import *
from datetime import datetime
import pytz
#----------------------------------------------------------------------... |
ant.py | # Ant
#
# Copyright (c) 2012, Gustav Tiger <gustav@tiger.name>
#
# 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, m... |
vehicle_detection_tracking_node.py | #!/usr/bin/env python
import rospy
import cv2
import numpy as np
from vehicle_detection_tracking.Detector import Detector
from vehicle_detection_tracking.Tracker import Tracker
from vehicle_detection_tracking.Introducer import Introducer
from cv_bridge import CvBridge, CvBridgeError
from duckietown_msgs.msg import Veh... |
MarketAnalysis.py | import csv
import threading
import time
import datetime
from cStringIO import StringIO
try:
import numpy
use_numpy = True
except ImportError as ex:
ex.message = ex.message if ex.message else str(ex)
print("WARN: Module Numpy not found, using manual percentile method instead. "
"It is recommend... |
remote.py | import os
import sys
import re
import csv
import time
import socket
import platform
import threading
import argparse
from colorama import init as color
from subprocess import run
# Console colors
color()
W = '\033[0m' # white (normal)
R = '\033[31m' # red
G = '\033[32m' # green
O = '\033[33m' # or... |
main.py | import numpy as np
import matplotlib.pyplot as plt
import datetime as dt
import os
import serial
import json
from threading import Thread
from mac_vendor_lookup import MacLookup
import urllib.request as urllib2
import json
import codecs
#从串口获取到mac(RSSI不管),遍历每个mac,每个查字典,如果已有->update;如果没有->新增。
dev_d... |
session.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... |
loop_through_airport_multithread.py | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 26 14:49:33 2019
@author: Rafael Amancio Diegues
Collect all arrivals and depart data for each airport, writing it all in a file
"""
import requests, json
import threading
import csv
import math
import time, calendar
import os
def flightsInAirportRequest(IATAcode, page... |
main.py | """
GUI Application to control the PiWall from
"""
#!/usr/bin/python3
# Author: Gunnar Holwerda
# GUI to control a PiWall
from tkinter import Frame, StringVar, OptionMenu, Listbox, Button, Label, Tk, END
from piwallcontroller.piwallcontroller import PiWallController
from piwallcontroller.playlist import Playlist
f... |
hdf5_Hyst_parallel.py | import glob, os, sys
import h5py
import numpy as np
import matplotlib.pyplot as plt
import multiprocessing
def info(title):
print(title)
print('module name:', __name__)
print('parent process:', os.getppid())
print('process id:', os.getpid())
def f(name):
info('function f')
print('hello', name... |
run-tests.py | #!/usr/bin/env 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 "L... |
__init__.py | """
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
This file is part of the Smart Developer Hub Project:
http://www.smartdeveloperhub.org
Center for Open Middleware
http://www.centeropenmiddleware.com/
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=... |
test_pvc_creation_deletion_performance.py | """
Test to verify performance of PVC creation and deletion
for RBD, CephFS and RBD-Thick interfaces
"""
import time
import logging
import os
import datetime
import pytest
import ocs_ci.ocs.exceptions as ex
import threading
import statistics
from concurrent.futures import ThreadPoolExecutor
from uuid import uuid4
from... |
wifigod.py | #!/usr/bin/env python
#coding: utf-8
#Coded and Developed by Blackhole Security
#BlackholeSecurity@protonmail.com
import sys
import multiprocessing
import urllib.request, urllib.parse, urllib.error
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
import threading
import requests
import pip
impo... |
widget.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
The widget is called from web2py.
"""
import datetime
import sys
import cStringIO
import time
import threa... |
nodeInterface.py | # ENVISIoN
#
# Copyright (c) 2019 Jesper Ericsson
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list o... |
services.py | import requests
import copy
from .models import JobCardModel, JobMetricsModel, HttpHeadersModel, JobDataModel
from bs4 import BeautifulSoup
from threading import Thread
# Write your model services here.
class JobCardService:
''' Handles the retrieval and storage of JobCardModel objects. '''
# Global variable... |
digital_display.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 NXEZ.COM.
# http://www.nxez.com
#
# Licensed under the GNU General Public 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.gnu.org/licen... |
rdd.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
collector-martas.py | """
Collector script for obtaining real time data from MARTAS machines
Collector accesses the autobahn websocket from MARTAS and retrieves data. This data is directly
added to a data bank (or file if preferred).
"""
import sys, os, csv
from twisted.python import log
from twisted.internet import reactor
try: # version ... |
context.py | import threading
from contextlib import contextmanager
class Context(threading.local):
def __init__(self):
self._ctx = [{}]
def __getattr__(self, name):
for scope in reversed(self._ctx):
if name in scope:
return scope[name]
raise AttributeError(name)
... |
servefiles.py | #!/usr/bin/env python
# coding: utf-8 -*-
import os
import socket
import struct
import sys
import threading
import time
import urllib
try:
from SimpleHTTPServer import SimpleHTTPRequestHandler
from SocketServer import TCPServer
from urllib import quote
input = raw_input
except ImportError:
from ht... |
info_s.py | import requests,urllib,socket,random,time,re,threading,sys,whois,json,os,xtelnet
import bs4
from bs4 import BeautifulSoup
from bane.payloads import *
if os.path.isdir('/data/data/com.termux/')==False:
import dns.resolver
def get_banner(u,p=23,timeout=3,payload=None):
try:
return xtelnet.get_banner(u,p=p,timeout=... |
test_framed_transport.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import sys
import logging
import socket
import threading
import time
from os import path
from unittest import TestCase
import pytest
from tornado import ioloop
import thriftpy
from thriftpy.tornado import make_server
from thriftpy.rpc import make_clien... |
server.py | #!/usr/bin/python
# logging should be setup first so imported modules' logging is configured too
import os
from vai.dpuv1.rt import logging_mp
log_file = os.environ['VAI_ALVEO_ROOT'] + "/neptune/logging.ini"
logging_mp.setup_logger(log_file, 'neptune')
from datetime import datetime
import json
import signal
import th... |
test_smtplib.py | import asyncore
import base64
import email.mime.text
from email.message import EmailMessage
from email.base64mime import body_encode as encode_base64
import email.utils
import hmac
import socket
import smtpd
import smtplib
import io
import re
import sys
import time
import select
import errno
import textwrap
import thre... |
advanced-reboot.py | #
# ptf --test-dir ptftests fast-reboot --qlen=1000 --platform remote -t 'verbose=True;dut_username="admin";dut_hostname="10.0.0.243";reboot_limit_in_seconds=30;portchannel_ports_file="/tmp/portchannel_interfaces.json";vlan_ports_file="/tmp/vlan_interfaces.json";ports_file="/tmp/ports.json";dut_mac="4c:76:25:f5:48:80";... |
simulator.py | from contextlib import contextmanager
import multiprocessing as mp
class Simulator:
def __init__(self, data_generator, pipeline):
self.data_generator = data_generator
self.data_gen_process = mp.Process(target=self.data_generator)
self.pipeline = pipeline
def start(self):
self... |
xpeek_proxy.py | """
This is an XPEEK listener that forwards messages to the NICE
SocketIO repeater on the data stream
This program requires sioclient and websocket packages to run.
"""
PROXY_PORT = 8001
#import threading
#import types
#import json
#import traceback
import sys
sys.path.append('../server/')
import numpy
import sio... |
__init__.py | import weakref
import gc
import threading
import unittest
from succession import _Chain, _SuccessionIterator, Succession, TimeoutError
class TestSuccession(unittest.TestCase):
def test_chain(self):
chain = _Chain()
chain.push(2)
self.assertEqual(chain.wait_result(), 2)
self.assert... |
kafka_mb.py | from typing import Any, Callable, List, Mapping, TypedDict
from kafka import KafkaProducer, KafkaConsumer
from helpers.transport.interface import MessageBus
from helpers.transport.kafka_config import KafkaEventMap
import threading
def get_kafka_connection_parameters(bootstrap_servers: str, sasl_mechanism: str, sasl_pl... |
im2rec.py | #!/usr/bin/env python3
# -*- 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 Licens... |
scheduler.py | import time
from multiprocessing import Process
from proxypool.api import app
from proxypool.getter import Getter
from proxypool.tester import Tester
from proxypool.db import RedisClient
from proxypool.setting import *
class Scheduler():
def schedule_tester(self, cycle=TESTER_CYCLE):
"""
定时测试代理
... |
app.py | # encoding: utf-8
'''
A REST API for Salt
===================
.. versionadded:: 2014.7.0
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
:depends:
- CherryPy Python module. Version 3.2.3 is currently recommended when
SSL is enabled, since this version worked the best with SSL in
internal testing.... |
ssl_test.py | #!/usr/bin/env python
"""Tests for API client + HTTPS server integration."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import datetime
import io
import os
import socket
import threading
from absl import app
from cryptography import x509
from cryptog... |
test_hub.py | # This file is part of Moksha.
# Copyright (C) 2008-2010 Red Hat, 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 b... |
cbleak.py | import asyncio
import logging
import platform
import queue
import threading
import time
import bleak
from pylgbst.comms import Connection, MOVE_HUB_HW_UUID_CHAR, MOVE_HUB_HW_UUID_SERV
log = logging.getLogger('comms-bleak')
class BleakDriver:
"""Driver that provides interface between API and Bleak."""
def ... |
__main__.py | import atexit
import traceback
import sys
import os
import time
import asyncio
import signal
import psutil
import torch.multiprocessing as mp
from packaging import version
from mindsdb.api.http.start import start as start_http
from mindsdb.api.mysql.start import start as start_mysql
from mindsdb.api.mongo.start impor... |
views.py | from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.contrib.auth import update_session_auth_hash
from .forms import CreateProject, DeleteProject, ItemName, FieldName, CreatePipeline, LinkGenerator, Scraper, Settings, ShareDB, ChangePass, ShareProject
from django.htt... |
ubr10k_arp_check.py | #!/usr/bin/env python
#+-----------------------------------------------------------------------+
#| File Name: ubr10k_arp_check.py |
#+-----------------------------------------------------------------------+
#| Description: This script checks UBR10K arp tables for abusive devices... |
conftest.py | import configparser
import ctypes
import os
import platform
import shutil
import sys
import tempfile
import time
from distutils.util import strtobool
from pathlib import Path
from shutil import copy
from subprocess import CalledProcessError, check_output
from threading import Thread
from unittest import mo... |
worker.py | import collections
import functools
import threading
import os.path
import tempfile
import shutil
import exifread
from PIL import Image
import gi
gi.require_version('Gdk', '3.0')
gi.require_version('GdkPixbuf', '2.0')
gi.require_version('GLib', '2.0')
from gi.repository import Gdk
from gi.repository import GdkPixbuf
... |
pserve.py | # (c) 2005 Ian Bicking and contributors; written for Paste
# (http://pythonpaste.org) Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license.php
#
# For discussion of daemonizing:
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731
#
# Code taken also from QP: http://www.mems-exch... |
email.py | # -*- coding:utf-8 -*-
# pipenv install flask-mail
from flask_mail import Mail
from flask_mail import Message
from flask import current_app, render_template
from threading import Thread
mail = Mail()
def send_async_email(app, msg):
with app.app_context():
try:
mail.send(msg)
except E... |
widget.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
The widget is called from web2py
----------------------------------
"""
from __future__ import print_... |
core.py | import json
import logging
import multiprocessing
multiprocessing.freeze_support()
from pathlib import Path
from settings_manager import SettingsManager
import subprocess
import platform
import sys
import threading
from datetime import datetime
from queue import Queue
from threading import Thread
from constants impo... |
vilib.py | import numpy as np
import cv2
import threading
from importlib import import_module
import os
from flask import Flask, render_template, Response
from multiprocessing import Process, Manager
import time
from utils import cpu_temperature
# from rgb_matrix import RGB_Matrix
app = Flask(__name__)
@app.route('/')
def index... |
pebble.py | # Copyright 2021 Canonical 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 writing, s... |
ntp.py | import random
import time
from scapy.all import IP, send, Raw, UDP
from threading import Thread
def NTP_ATTACK(threads, attack_time, target):
# Finish
global FINISH
FINISH = False
target_ip = target.split(":")[0]
target_port = int(target.split(":")[1])
print("[#] Attack started for " + str(attack_... |
core.py | import datetime as dt
import mimetypes
import os
import threading as th
import time as tm
from flask import Flask, Blueprint, render_template
from flask_mail import Mail, Message
from flask_sqlalchemy import SQLAlchemy
from flask_mailalchemy.model import AttachmentMixin, EmailMixin
class MailAlchemy:
"""Flask-M... |
main.py | # ///////////////////////////////////////////////////////////////
#
# BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0
#
# This project can be used freely for all uses, as long as they maintain the
# respective credits only in the Python scripts, any information in the visual
# interface ... |
eye_tracker.py | """
@title
@description
"""
import os
import threading
import time
import cv2
import dlib
import numpy as np
from auto_drone import DATA_DIR
def shape_to_np(shape, dtype='int'):
coords = np.zeros((68, 2), dtype=dtype)
for i in range(0, 68):
coords[i] = (shape.part(i).x, shape.part(i).y)
return c... |
rosbag_api_recording_1_generate_output.py | #!/usr/bin/env python
import roslib
import rospy
import smach
import smach_ros
from geometry_msgs.msg import Point
from geometry_msgs.msg import Point32
from geometry_msgs.msg import PointStamped
from geometry_msgs.msg import Pose
from geometry_msgs.msg import PoseStamped
from geometry_msgs.msg import Quate... |
ui_utils.py | # -*- coding: utf-8 -*-
import collections
import logging
import os
import platform
import re
import shutil
import signal
import subprocess
import textwrap
import threading
import time
import tkinter as tk
import tkinter.font
import traceback
from tkinter import filedialog, messagebox, ttk
from typing import Callable, ... |
PC_Miner.py | #!/usr/bin/env python3
##########################################
# Duino-Coin Python PC Miner (v2.45)
# https://github.com/revoxhere/duino-coin
# Distributed under MIT license
# © Duino-Coin Community 2019-2021
##########################################
# Import libraries
import sys
from configparser import C... |
irc_server.py | import logging
import socket
import threading
import click
logging.basicConfig(filename="server.log", level=logging.DEBUG)
logger = logging.getLogger()
class IRCServer:
def __init__(self, port):
# Need to use gethostbyname_ex() when host has multiple interfaces
self.host = socket.gethostbyname_ex... |
reconstructor.py | from __future__ import print_function, division
import time, os, sys
from datetime import datetime
from cryoio.imagestack import MRCImageStack, CombinedImageStack
from cryoio.ctfstack import CTFStack, CombinedCTFStack
from cryoio.dataset import CryoDataset
opj = os.path.join
from copy import copy, deepcopy
import nu... |
ArmoryQt.py | #!/usr/bin/python2
# -*- coding: UTF-8 -*-
##############################################################################
# #
# Copyright (C) 2011-2015, Armory Technologies, Inc. #
# Distributed under the GNU Affero Gener... |
inmemory_buffer.py | # Copyright 2020 Wearless Tech 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 by applicable law... |
backtester_coin_vc.py | import os
import sys
import sqlite3
import pandas as pd
from matplotlib import pyplot as plt
from multiprocessing import Process, Queue
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
from utility.static import now, strf_time, timedelta_day
from utility.setting import db_setting, db_backtes... |
utils.py | # Copyright 2016-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import torch, glob, os, numpy as np
from .sparseConvNetTensor import SparseConvNetTensor
from .metadata import Metadata
de... |
static_size.py | #!/usr/bin/env python
'''Build the platform independent, non-test related code of ubxlib to establish static sizes.'''
from multiprocessing import Process, freeze_support # Needed to make Windows behave
# when run under multiprocessing,
from signal import signal, SI... |
acilPB[1].py | # -*- coding: utf-8 -*-
import PRANKBOTS
from PRANKBOTS.lib.curve.ttypes import *
from datetime import datetime
import io,os,re,ast,six,sys,glob,json,time,timeit,codecs,random,shutil,urllib,urllib2,urllib3,goslate,html5lib,requests,threading,wikipedia,subprocess,googletrans
from gtts import gTTS
from random import r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.