source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
translate_sqls.py | from tqdm import tqdm
from sql_formatter.formatting import translate_sql
import json
import random
import multiprocessing
from multiprocessing import Manager
sql_translation ={}
def trans_sql(raw_sql, sql):
try:
translated_sql, translated_struct_sql = translate_sql(sql)
#return_dict[raw_sql] = ... |
vamojoga.py | from api import send_message, edit_message_text
from reborn import log
import threading
import time
import sched
VOTING_DURATION_IN_SECS = 180
MARKUP = "{%22inline_keyboard%22:[[{%22text%22:%22EUVO%22,%22callback_data%22:%221%22},%20{%22text%22:%22nemvo%22,%22callback_data%22:%220%22}]]}"
# hack horrível, mas por enq... |
client_rpc_server.py | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""The client RPC server code.
This server is an XML-RPC server which serves code from
client_rpc_methods.RPCMethods.
This server will run until shutdown i... |
subproc_vec_env.py | import numpy as np
from multiprocessing import Process, Pipe
from baselines0.common.vec_env import VecEnv, CloudpickleWrapper
from baselines0.common.tile_images import tile_images
def worker(remote, parent_remote, env_fn_wrapper):
parent_remote.close()
env = env_fn_wrapper.x()
while True:
cmd, dat... |
test_logging.py | # Copyright 2001-2017 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this perm... |
test_issue_701.py | import asyncio
import collections
import logging
import os
import threading
import time
import unittest
import pytest
from integration_tests.env_variable_names import SLACK_SDK_TEST_CLASSIC_APP_BOT_TOKEN
from integration_tests.helpers import async_test, is_not_specified
from slack import RTMClient, WebClient
class ... |
scanner.py | Venkat deops
#!/usr/bin/python3
import sys
import time
import shodan
import argparse
import requests
from datetime import datetime
from threading import Thread, activeCount
# Shodan API Key (change according to your Shodan API key)
api_key = ''
# Shodan search query
search_query = '"http://cis.citrix.com"'
def getTim... |
coldsteelapp.py | import tkinter as tk
from tkinter import font
import tkinter.ttk as ttk
import tkinter.filedialog as filedialog
import tkinter.messagebox as messagebox
import os, threading
class ColdSteelApp:
def __init__(self, master=None):
# build ui
# main frame
self.frameMain = ttk.Frame(master)
... |
blinkDetect.py | import dlib
import sys
import cv2
import time
import numpy as np
from scipy.spatial import distance as dist
from threading import Thread
import playsound
import queue
FACE_DOWNSAMPLE_RATIO = 1.5
RESIZE_HEIGHT = 460
thresh = 0.27
modelPath = "models/shape_predictor_70_face_landmarks.dat"
sound_path = "alarm.wav"
dete... |
tensorboard_server_test.py | # Copyright 2015 Google 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 or a... |
test_client.py | import socket
import sys
import threading
import tkinter
import tkinter.scrolledtext
from tkinter import simpledialog
HOST = '127.0.1.1'
PORT = 9090
FORMAT = 'utf-8'
class Client:
def __init__(self, host, port):
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.connect((host... |
autoreload.py | import functools
import itertools
import logging
import os
import signal
import subprocess
import sys
import threading
import time
import traceback
import weakref
from collections import defaultdict
from pathlib import Path
from types import ModuleType
from zipimport import zipimporter
import django
from django.apps i... |
__main__.py | import threading
from Savetube.youtubedltojson import YoutubedlTojson
import os
import itertools
import sys
import time
import getopt
import pyfiglet
from pyfiglet import Figlet
from termcolor import colored, cprint
import youtube_dl.postprocessor as ytpp
from Savetube.ffmpeg import GetFFmpeg
from Savetube.version impo... |
alpacastore.py | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import collections
import time
from enum import Enum
import traceback
from datetime import datetime, timedelta, time as dtime
from dateutil.parser import parse as date_parse
import time as _time
impor... |
game_client.py | from socket import *
import threading
import tkinter as tk
from tkinter import PhotoImage, messagebox
from threading import *
import re
from time import sleep
import sys
from tkinter.font import BOLD
# costanti
BUFSIZE = 4096
FORMAT = 'utf-8' # prima era 'utf8'
HOST = '127.0.0.1'
PORT = 53000
ADDR = (... |
test_server_client.py | import multiprocessing as mp
import os
from queue import Empty as QueueIsEmpty
import pytest
from ucp._libs import ucx_api
from ucp._libs.arr import Array
from ucp._libs.utils_test import blocking_recv, blocking_send
mp = mp.get_context("spawn")
def _echo_server(get_queue, put_queue, msg_size, endpoint_error_handl... |
rocket.py | # -*- coding: utf-8 -*-
# This file is part of the Rocket Web Server
# Copyright (c) 2011 Timothy Farrell
# Modified by Massimo Di Pierro
# Import System Modules
import sys
import errno
import socket
import logging
import platform
from gluon._compat import iteritems, to_bytes, to_unicode, StringIO
from gluon._compat... |
app.py | import time
import subprocess
import signal
import functools
import csv
import os
from os import listdir
from os.path import isfile, join
from libnmap.process import NmapProcess
from libnmap.parser import NmapParser
from libnmap.objects.os import NmapOSClass
from scapy.all import *
import eel
eel.init('web')
class... |
main.py | import datetime
import json
import random
import re
import time
from threading import Thread
import vk_api
from vk_api.longpoll import VkLongPoll, VkEventType
class Settings:
__slots__ = ["Token", "TriggerStickers", "Answers",
"TimeWait", "TriggerDelete",
"TriggerTranslate",
... |
handlers.py | # Copyright 2001-2016 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this perm... |
mangle.py | """Formatting and file mangling support."""
import functools
import multiprocessing
import os
import re
import signal
import traceback
from datetime import datetime
from snakeoil.cli.exceptions import UserException
from snakeoil.mappings import OrderedSet
copyright_regex = re.compile(
r'^# Copyright (?P<begin>\d... |
forest.py | import worker as mt
import sys
import numpy as np
import matplotlib.pyplot as plt
from copy import deepcopy
from multiprocessing import Process, Manager
from master_node import MasterNode
sys.path.append('../model/')
from weatherTLKT import Weather
from simulatorTLKT import Simulator, HOURS_TO_DAY
class Forest:
... |
run.py | import os
import sys
import time
import torch
import numpy as np
import numpy.random as rd
import multiprocessing as mp
from elegantrl.env import build_env, build_eval_env
from elegantrl.replay import ReplayBuffer, ReplayBufferMP
from elegantrl.evaluator import Evaluator
"""[ElegantRL.2021.11.08](https://github.com/... |
dropper.py | import base64
import threading
import time
import tkinter
import zlib
import pyperclip
import qrcode
from PIL import ImageTk
window: tkinter.Tk = None
def main():
global window
window = tkinter.Tk()
window.overrideredirect(True)
window.wm_attributes("-topmost", True)
window.wm_attributes("-disab... |
pozyskiwanie_danych.py | import urllib.request
import re
from tqdm import tqdm
from threading import Thread
import os
import sys
od_roku = str(sys.argv[1])
liczba_watkow = 32
liczba_stron_do_przejrzenia = 20
lista_stron =['https://sin.put.poznan.pl/search/publications/all?yearFrom={}&yearTo=2020&disciplineCode=inzynieria-mechaniczna&page={... |
parallel_runner.py | import ray
import logging
import ray.util.queue
import time
from multiprocessing import Process, Queue
import copy
def worker(queue_jobs, queue_results, para_shared):
para_own = copy.deepcopy(para_shared)
while 1:
job = queue_jobs.get()
# print(job)
if job is None:
queue_r... |
manager.py | from navigate import Nav
from planet import Planet
from observer import Observer
import time
from log import log
from date import Date
import units
from threading import Thread, Lock
class Manager:
"""Class to create and manage the different threads controlling the account"""
# Class Parameters
DELAY = 3... |
test_ssl.py | # -*- coding: utf-8 -*-
# Test the support for SSL and sockets
import sys
import unittest
from test import test_support as support
from test.script_helper import assert_python_ok
import asyncore
import socket
import select
import time
import datetime
import gc
import os
import errno
import pprint
import shutil
import ... |
face_recognition.py | import cv2
import numpy as np
import os
import json
import base64
import paho.mqtt.client as mqtt
import time
import sys
import threading
import RPi.GPIO as GPIO
import mlx90614
from smbus2 import SMBus
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO_BUZZER = 17
GPIO_TRIGGER = 23
GPIO_ECHO = 24
GPIO.setup(GPIO_BU... |
vpp_transport_socket.py | #
# VPP Unix Domain Socket Transport.
#
import socket
import struct
import threading
import select
import multiprocessing
try:
import queue as queue
except ImportError:
import Queue as queue
import logging
from . import vpp_papi
class VppTransportSocketIOError(IOError):
# TODO: Document different values o... |
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... |
server.py | # =============================================================================
# Federal University of Rio Grande do Sul (UFRGS)
# Connectionist Artificial Intelligence Laboratory (LIAC)
# Renato de Pontes Pereira - rppereira@inf.ufrgs.br
# =============================================================================
... |
test_randomstate.py | import hashlib
import pickle
import sys
import warnings
import numpy as np
from numpy.testing import (
assert_,
assert_array_almost_equal,
assert_array_equal,
assert_equal,
assert_no_warnings,
assert_raises,
assert_warns,
suppress_warnings,
)
import pytest
from randomgen.mt19937 import... |
vcfMerger2.py | #!/usr/bin/env python3
### vcfMerger2
###
### MIT License
###
### Copyright (c) 2018 Translational Genomics Research Institute
###
### 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 witho... |
Duzz_Port_Scanner.py | import fescripts.libs.fescripts
from fescripts.libs.PFable import fable,fable_mode
from colorama import init
init()
from colorama import Fore,Back
import socket,threading
import signal
class Duzz_Port_Scanner:
def signal_handler(self,sig, frame):
self._end()
signal.signal(signal.SIGINT, signal... |
ZombidleBot.py | import io, sys
import os, datetime, time
import numpy as np
import cv2
import pytesseract
import ZombidleBot.settings.Settings as bs
import ZombidleBot.ImageAnalyser as ia
import ZombidleBot.BotEngine as be
import ZombidleBot.LaunchZombidle as lz
import ZombidleBot.Hook as hk
import importlib
import logging
from log... |
test_socket.py | import unittest
from test import support
from test.support import os_helper
from test.support import socket_helper
from test.support import threading_helper
import errno
import io
import itertools
import socket
import select
import tempfile
import time
import traceback
import queue
import sys
import os... |
device_machine.py | import datetime
import json
import time
import jwt
import paho.mqtt.client as mqtt
from aiy.enviro import EnviroKit
from aiy.cloudiot import CloudIot
from luma.core.render import canvas
from PIL import ImageDraw, ImageFont
from time import sleep
import threading
from . import tilter
from gpiozero import LED
# import ... |
pfd.py | #!/usr/bin/python3
import pygame
import pygame.gfxdraw
from pygame.locals import *
import math
import os
import signal
from subprocess import call
import threading
import subprocess
import socket
from struct import *
import collections
import numpy as np
import os.path
from os import path
import json
import time
from ... |
web.py | import socket
import threading
import re
import json
from collections import defaultdict
from base64 import b64encode
from html import escape as escape_html
from urllib.parse import quote_plus
class _Html(object):
def __init__(self, template, values):
if len(values):
self.value = template.form... |
powerswitch_tail_gpio.py | """
Description
Turn the PowerSwith Tail II on and off and communicate it's status over
the websocet connection
"""
import time
import threading
import websocket
import RPi.GPIO as GPIO
try:
import simplejson as json
except ImportError:
import json
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
OUT... |
tracing_test.py | # Lint as: python3
# Copyright 2019, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... |
util.py | import threading
import time
import json
import os
import sys
import logging
import traceback
import pytest
from uuid import uuid4
from multiprocessing import Process, Queue
logger = logging.getLogger('pywebview')
def run_test(webview, window, thread_func=None, param=None, start_args={}, no_destroy=False, destroy_de... |
example_binance_dex.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_binance_dex.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://www.lucit.tech/unicorn-binance-websocket-api.html
# Github: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api
# Documentation: https://unico... |
bars_api_getter.py | import json
import threading
import requests
from analytics_project import settings
EDUC_PROGRAMS = []
BASE_URL = "https://cas.crp.rocks/backend//rest"
BASE_HEADERS = {'content-type': 'application/json'}
def login():
url = BASE_URL + "/login"
body = {"login": settings.BARS["BARS_LOGIN"], "password": settin... |
create_dataset.py | # PsykoDev
import os
import sys
import platform
import numpy as np
from time import sleep
from PIL import ImageGrab
from game_control import *
from predict import predict
from scipy.misc import imresize
from game_control import get_id
from get_dataset import save_img
from multiprocessing import Process
from keras.model... |
util.py | #
# pyprob
# PyTorch-based library for probabilistic programming and inference compilation
# https://github.com/probprog/pyprob
#
import time
import datetime
import logging
import sys
import math
from termcolor import colored
from threading import Thread
import cpuinfo
from glob import glob
from PIL import Image
impor... |
example_test.py | # This example code is in the Public Domain (or CC0 licensed, at your option.)
# Unless required by applicable law or agreed to in writing, this
# software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied.
# -*- coding: utf-8 -*-
from __future__ import pri... |
_speech_transcriber.py | # -*- coding: utf-8 -*-
"""
* Copyright 2015 Alibaba Group Holding Limited
*
* 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
*
* Unl... |
perceptMap.py | from kivy.app import App
from kivy.uix.image import Image
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.core.window import Window
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.checkbox import CheckBox
from kivy.properties impo... |
server.py | import root.settings as settings
import root.api.rest.rest_routes as rest
from root.api.rest.rest_routes import app
import root.api.mqtt.mqtt_routes as mqtt
from werkzeug.serving import run_simple
import threading
def start_server():
thread = threading.Thread(target = start_thread)
thread.start()
mqtt.con... |
test_signal.py | import enum
import errno
import os
import random
import signal
import socket
import statistics
import subprocess
import sys
import threading
import time
import unittest
from test import support
from test.support import os_helper
from test.support.script_helper import assert_python_ok, spawn_python
try:
import _test... |
wsdump.py | #!/Users/bansept/Documents/Recherche/Postdoc/Project_Jenna/jupyter_webapp/webapp_venv/bin/python3
"""
wsdump.py
websocket - WebSocket client library for Python
Copyright 2021 engn33r
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You m... |
training.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
import warnings
import copy
import time
import numpy as np
import multiprocessing
import threading
import six
try:
import queue
except ImportError:
import Queue as queue
from .topology import Container
from .... |
keyboard_monitor.py | #!/usr/bin/env python
#-*- coding:utf-8 -*-
from pynput import keyboard
import time
import os
import mido
from mido import Message, MidiFile, MidiTrack, tempo2bpm
import queue
import threading
from enum import Enum
midi_seqs = {
"'a'": [0, False],
"'w'": [1, False],
"'s'": [2 , False],
... |
broker.py | #
# CORE
# Copyright (c)2010-2013 the Boeing Company.
# See the LICENSE file included in this distribution.
#
# author: Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com>
#
'''
broker.py: definition of CoreBroker class that is part of the
pycore session object. Handles distributing parts of the emulation out to
other emul... |
train_mask_rcnn.py | """Train Mask RCNN end to end."""
import argparse
import os
# disable autotune
os.environ['MXNET_CUDNN_AUTOTUNE_DEFAULT'] = '0'
os.environ['MXNET_GPU_MEM_POOL_TYPE'] = 'Round'
os.environ['MXNET_GPU_MEM_POOL_ROUND_LINEAR_CUTOFF'] = '28'
os.environ['MXNET_EXEC_BULK_EXEC_MAX_NODE_TRAIN_FWD'] = '999'
os.environ['MXNET_EXE... |
rfc2217.py | #! python
#
# This module implements a RFC2217 compatible client. RF2217 descibes a
# protocol to access serial ports over TCP/IP and allows setting the baud rate,
# modem control lines etc.
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C) 2001-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX... |
server.py | from settings import settings
from threads import worker, threading
import socket
def main():
server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
server_socket.bind(settings.local_host)
post_sockets = []
for post_host in settings.post_host:
p_socket = socket.socket(socket.AF_INET... |
test_operator_gpu.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... |
visualize.py | from pygame.locals import *
from OpenGL.GLU import *
from OpenGL.GL import *
import numpy as np
import threading
import pygame
import math
def getMinMax(landmarks):
xmin, xmax = landmarks[0][0], landmarks[0][0]
ymin, ymax = landmarks[0][1], landmarks[0][1]
zmin, zmax = landmarks[0][2], landmarks[0][2]
... |
dapp_browser.py | from shadowlands.sl_dapp import SLDapp, SLFrame
from shadowlands.sl_dapp.sl_network_dapp import SLNetworkDapp
from shadowlands.sl_contract.sloader import SLoader
from asciimatics.widgets import Layout, Label, Button, Divider, TextBox
from asciimatics.effects import Print
from asciimatics.renderers import StaticRenderer... |
action.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 kirmani <sean@kirmani.io>
#
# Distributed under terms of the MIT license.
"""
Action.
"""
from multiprocessing import Process
import os
import signal
class Action:
def __init__(self, name, entities, preconditions, postconditions):... |
telega_bot.py | import telebot
import schedule
from threading import Thread
from telebot import types
from datetime import date
from time import sleep
from goal_check import *
API_KEY = ''
bot = telebot.TeleBot(API_KEY)
users = set()
markup = types.ReplyKeyboardMarkup(one_time_keyboard=True)
markup.add('SOCCER⚽️', 'BASKETBALL🏀')
... |
tpu_estimator.py | # Copyright 2017 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... |
Infrared_transmit.py | #
# Created on Sat Oct 09 2021
# Author: Owen Yip
# Mail: me@owenyip.com
#
import os,sys
pwd = os.path.abspath(os.path.abspath(__file__))
father_path = os.path.abspath(os.path.dirname(pwd) + os.path.sep + "..")
sys.path.append(father_path)
import time
import threading
import json
from datetime import datetime
from Se... |
utils.py | # Copyright (c) 2013 Ondrej Kipila <ok100 at openmailbox dot org>
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See the COPYING file for more details.
"""Common functions used across the whol... |
web.py | # Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights t... |
CLI.py | '''******************************************************************************
* Copyright (c) 2019 Analog Devices, 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:
* - Redistributions of so... |
HiwinRA605_socket_ros_20190604112102.py | #!/usr/bin/env python3
# license removed for brevity
#接收策略端命令 用Socket傳輸至控制端電腦
import socket
##多執行序
import threading
import time
##
import sys
import os
import numpy as np
import rospy
import matplotlib as plot
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import HiwinRA605_s... |
gobgp.py | # Copyright (C) 2015 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
simultaneous_read.py | def read_csv():
import csv
import datetime
datetime.datetime.now().time()
print(str(datetime.datetime.now().time()) + " READING CSV")
with open('output.csv', 'r', newline='') as f:
reader = csv.reader(f)
for row in reader:
print(row)
def write_csv():
import csv, r... |
__init__.py | # -*- coding: utf-8 -*-
"""
:copyright: Copyright 2016-2022 Sphinx Confluence Builder Contributors (AUTHORS)
:license: BSD-2-Clause (LICENSE)
"""
from bs4 import BeautifulSoup
from contextlib import contextmanager
from copy import deepcopy
from pkg_resources import parse_version
from sphinx.__init__ import __version__... |
test_dist_train.py | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
run_TCP.py | import argparse
import logging
import time
import cv2
import numpy as np
from estimator import TfPoseEstimator
from networks import get_graph_path, model_wh
#====================
from socket import socket, AF_INET, SOCK_STREAM
import threading
import time
from tkinter import *
import tkinter as tk
import os
from PIL... |
email.py | from threading import Thread
from flask import render_template
from flask_mail import Message
from flask_babel import _
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(su... |
accessPointFinder.py | from scapy.all import *
import threading
from interface import Interface
import time
class AccessPointFinder:
def __init__(self, interface):
print interface
self.interface = Interface(interface, True)
self._should_continue = True
self.aps_desc = list()
self.aps = list()
def _sniff_packet(self):
self.in... |
main.py | import sys
import MazeGame
import subprocess
import datetime
import json
import requests
from time import sleep, strftime, localtime
from sense_hat import SenseHat
from collections import OrderedDict
from multiprocessing import Process, Queue, Pipe
from threading import Thread
# Data der skal læses fra databasen
# : m... |
imdb62.py | import features
import stanford_parser
import c_syntax_tree as st
from pos import pos_tags
import gc
#from memory_profiler import profile
import shelve
import time
import queue
import threading
import itertools
import diskdict
import sys
import syntax_cache
documentbase=None
functionCollection=None
cacheUpdateNeeded=Fa... |
runtests.py | #!/usr/bin/env python
from __future__ import print_function
import atexit
import os
import sys
import re
import gc
import heapq
import locale
import shutil
import time
import unittest
import doctest
import operator
import subprocess
import tempfile
import traceback
import warnings
import zlib
import glob
from context... |
main.py | #!/bin/python3
import threading
from http_server import run_http_server
from commands_executor import run_commands_executor
from scraper import start_scraping, wait_until_elasticsearch_avaliable
if __name__ == "__main__":
try:
import os
PORT = int(os.environ["PORT"])
except (ValueError, KeyE... |
datasets.py | from flask import request
from flask_restplus import Namespace, Resource, reqparse
from flask_login import login_required, current_user
from werkzeug.datastructures import FileStorage
from mongoengine.errors import NotUniqueError
from mongoengine.queryset.visitor import Q
from threading import Thread
from google_image... |
main.py | import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import time
from threading import Thread
import requests.packages.urllib3
requests.packages.urllib3.disable_warnings()
import tweepy
import os
import locale
import coinmarketcap
import decimal
import PIL
from exch... |
application_backend.py | import gc
import subprocess
import multiprocessing
import argparse
import random
import time
import os
def synthesize(speaker_id, text, filename, model_used="libritts", sigma=0.2, n_frames=65536):
import os
from os.path import exists, join, basename, splitext
from scipy.io.wavfile import write
import j... |
test_reload.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2019 tecnovert
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
"""
export TEST_RELOAD_PATH=/tmp/test_basicswap
mkdir -p ${TEST_RELOAD_PATH}/bin/{particl,bitcoin}
cp ~... |
extract.py | from __future__ import absolute_import, print_function
import argparse
import collections
import hashlib
import heapq
import logging
import multiprocessing
import os.path
import sqlite3
import sys
import tarfile
import traceback
from datetime import datetime
from typing import DefaultDict, List, Optional, Tuple
impor... |
BB_RC_data_parse_test.py | import time
import datetime as dt
import serial
from queue import Queue, Empty
from threading import Thread
import numpy as np
import os, sys
import maestro
# serial setups
time.sleep(0.25)
RCSer = serial.Serial('/dev/ttyUSB0',baudrate = 115200) # varies on which is plugged first
time.sleep(0.25)
SensorSer = serial.S... |
netconsole_controller.py | import asyncio
from aiohttp import web, errors as weberrors
import socket
import threading
import atexit
import sys
import time
from queue import Queue, Empty
UDP_IN_PORT=6666
UDP_OUT_PORT=6668
received_logs = list()
log_store_limit = 200
log_resend_limit = 25
@asyncio.coroutine
def netconsole_monitor():
# set u... |
telnet.py | import util
import socket
from colors import color
from service import Service
from threading import Thread
from zoption import Zoption
class telnet(Service):
def __init__(self):
super(telnet, self).__init__('telnet server')
self.server_thread = None
self.server_socket = None
self.... |
app.py | import os
import subprocess
import re
import time
from threading import Lock,Thread
from collections import deque
import requests
from flask import Flask, request, redirect, url_for, flash, render_template, jsonify
from werkzeug.urls import url_parse
from werkzeug.security import generate_password_hash, check_password_... |
iotSDR_GPS_streamer.py | # Copyright (c) 2020, embedINN
# 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 of conditions and the foll... |
test_debug.py | import importlib
import inspect
import os
import re
import sys
import tempfile
import threading
from io import StringIO
from pathlib import Path
from unittest import mock
from django.core import mail
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db import DatabaseError, connection
from djan... |
test_csv.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... |
multiple-queue.py | import threading
import time
from queue import Queue
import requests
hosts = ['https://api.ipify.org', 'https://google.com']
queue = Queue()
outqueue = Queue()
class ThreadUrl:
"""Threaded Url Grab"""
def __init__(self, queue, outqueue):
self.queue = queue
self.outqueue = outqueue
def ... |
display_st7789_240x320.py | #!/usr/bin/env python3
'''
*****************************************
PiFire Display Interface Library
*****************************************
Description:
This library supports using
the ST7789 display with resolution.
This module utilizes the Pimoroni libraries
to interface this display.
*******************... |
object_detector.py | # -*- coding: utf-8 -*-
# Copyright © 2017 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
"""
Class definition and utilities for the object detection toolkit.
"""
from __futu... |
web.py | #!/usr/bin/env python3
import time
import threading
from flask import Flask
import cereal.messaging as messaging
app = Flask(__name__)
pm = messaging.PubMaster(['testJoystick'])
index = """
<html>
<head>
<script src="https://github.com/bobboteck/JoyStick/releases/download/v1.1.6/joy.min.js"></script>
</head>
<body>
... |
threading_enumerate.py | #!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2008 Doug Hellmann All rights reserved.
#
"""Using enumerate() to find the active threads.
"""
#end_pymotw_header
import random
import threading
import time
import logging
def worker():
"""thread worker function"""
pause = random.randint(1, 5) / 10
... |
h2h_evaler.py | # 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.
from typing import Dict, Optional, Tuple, Sequence
import collections
import json
import logging
import pathlib
import random
import time
im... |
start_scheduler.py | # Imports
import os
import sys
import uuid
import time
import socket
import argparse
import threading
import subprocess
import logging
from mpi4py import MPI
from azureml.core import Run
from notebook.notebookapp import list_running_servers
def flush(proc, proc_log):
while True:
proc_out = proc.stdout.re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.