source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
proxier.py | import atexit
from concurrent import futures
from dataclasses import dataclass
import grpc
import logging
from itertools import chain
import json
import socket
import sys
from threading import Event, Lock, Thread, RLock
import time
import traceback
from typing import Callable, Dict, List, Optional, Tuple
import ray
fr... |
reader.py | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
reconfigure_test.py | import threading, time
from diggi_build import build_diggi, output_dir_name
from diggi_orchestration import RunNodeDebug, UpdateConfiguration
build_diggi("configuration.json")
def run_node():
RunNodeDebug(output_dir_name,"4442",1)
url = "http://localhost:4442/"
t = threading.Thread(target=run_node)
t.start()
t... |
rfc2217.py | #! python
#
# Python Serial Port Extension for Win32, Linux, BSD, Jython
# see __init__.py
#
# 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.
#
# (C) 2001-2009 Chris Liechti <cliechti@gmx.ne... |
server.py | from __future__ import annotations
import json
import logging
import socket
import threading
import pymunk
from pygame.time import Clock
from pymunk import Body, Space
from pymunk.shapes import Segment
from cop_common.network import DEFAULT_PORT, format_address
from cop_server.consts import TICK_RATE
class Server:... |
tests.py | """Test Rogers demo."""
from __future__ import print_function
import sys
import random
import traceback
from datetime import datetime
import subprocess
import re
import requests
import threading
import time
from dallinger import db
from dallinger.nodes import Agent, Source, Environment
from dallinger.information imp... |
test_replication.py | """TestCases for distributed transactions.
"""
import os
import time
import unittest
from test_all import db, test_support, have_threads, verbose, \
get_new_environment_path, get_new_database_path
#----------------------------------------------------------------------
class DBReplication(unittest.TestCase)... |
recon.py | """
This module handles all the operations regarding locating all the
available access points
"""
from __future__ import division
import threading
import time
import logging
import scapy.layers.dot11 as dot11
import wifiphisher.common.constants as constants
logger = logging.getLogger(__name__)
class AccessPoint(obj... |
bgapi.py | from __future__ import print_function
# for Python 2/3 compatibility
try:
import queue
except ImportError:
import Queue as queue
import logging
import serial
import time
import threading
from binascii import hexlify, unhexlify
from uuid import UUID
from enum import Enum
from collections import defaultdict
f... |
visualizer.py | '''
@Author: wei
@Date: 2020-05-14 13:00:54
@LastEditors: wei
@LastEditTime: 2020-05-20 15:33:49
@Description: file content
'''
import time
import os
import threading
import psutil
import humanize
import GPUtil as GPU
import torch
from thop import profile
GPUs = GPU.getGPUs()
gpu = GPUs[0]
SHOW_GPU_USAGE_TIME = 60
d... |
__init__.py | # -*- coding: utf-8 -*-
# @Time : 4/12/2019 14:02
# @Author : MARX·CBR
# @File : __init__.py.py
import threading
import sys
from PyQt5 import QtWidgets
from updateServer.HotUpdate import myfunction
import redis
import random
import importlib
from updateServer.HotUpdate.HotFixSample import Ui_MainWindo... |
test_utils.py | # -*- coding: utf-8 -*-
import json
import os
import shutil
import tempfile
import time
import zipfile
import multiprocessing
import contextlib
from unittest import mock
from django import forms
from django.conf import settings
from django.core.files.storage import default_storage as storage
from django.core.files.up... |
threads.py | import threading
def runFunc(functionToRun, argsToRun=None):
if argsToRun:
func = threading.Thread(target=functionToRun, kwargs=(argsToRun,))
else:
func = threading.Thread(target=functionToRun)
func.start()
|
downloader.py | """
Support for functionality to download files.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/downloader/
"""
import logging
import os
import re
import threading
import requests
import voluptuous as vol
from homeassistant.helpers import validate_con... |
burst.py | # -*- coding: utf-8 -*-
"""
Burst processing thread
"""
import re
import json
import time
import xbmc
import xbmcaddon
import xbmcgui
from Queue import Queue
from threading import Thread
from urlparse import urlparse
from urllib import unquote
from elementum.provider import append_headers, get_setting, log
from pars... |
worker_test_temp.py | # standard library imports
import socket
import sys
import time
from pathlib import Path
from threading import Lock, Thread
# local imports
import tmrl.config.config_constants as cfg
import tmrl.config.config_objects as cfg_obj
from tmrl.envs import GenericGymEnv
from tmrl.networking import RolloutWorker
from tmrl.uti... |
webcam.py | import cv2
import time
import threading
from flask import Response, Flask
# import dataset_utils
from dataset_utils import *
from config import *
cfg = Config()
# Image frame sent to the Flask object
global webcam_video_frame
webcam_video_frame = None
# Use locks for thread-safe viewing of frames in multiple browsers... |
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... |
awg_phasing.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import time
import socket
import numpy as np
from multiprocessing import Process, Pipe
#from PyQt5.QtWidgets import QListView, QAction, QWidget
from PyQt5.QtWidgets import QFileDialog, QWidget
from PyQt5 import QtWidgets, uic #, QtCore, QtG... |
persist.py | from collections import defaultdict
from queue import Queue, Empty
import threading
import traceback
import time
import sublime
from .util import merge_user_settings
class Daemon:
running = False
callback = None
q = Queue()
last_run = {}
def __init__(self):
self.settings = {}
self... |
test_hybrid_cfnn.py | #!/usr/bin/env python
# ------------------------------------------------------------------------------------------------------%
# Created by "Thieu" at 10:01, 13/07/2021 %
# ... |
progSound(backup27022016).py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pygame import mixer
import threading, random, socket
play = 0
file = 0
sock = socket.socket()
sock.bind(('', 6003))
sock.listen(1)
conn, addr = sock.accept()
#sock.settimeout(.01)
def soundPlayer(arg3, soundPlayer_stop):
global file
global play
while 1... |
inference_video.py | """
Inference video: Extract matting on video.
Example:
python3 V2wd/inference_video.py \
--model-type mattingrefine \
--model-backbone resnet50 \
--model-backbone-scale 0.25 \
--model-refine-mode sampling \
--model-refine-sample-pixels 80000 \
--model-checkpoint "/... |
interface.py | #!/usr/bin/python3 -OO
# Copyright 2007-2020 The SABnzbd-Team <team@sabnzbd.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any late... |
test_flight.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... |
reward_tts_streamlabs.py | import logging
import base64
import random
import re
import time
import threading
import requests
from pajbot.models.command import Command
from pajbot.models.user import User
from pajbot.managers.handler import HandlerManager
from pajbot.managers.db import DBManager
from pajbot.modules import BaseModule
from pajbot.m... |
test.py | import torch
import torch.nn as nn
import os
import numpy as np
import tqdm
import json
from AFSD.common import videotransforms
from AFSD.common.anet_dataset import get_video_info, load_json
from AFSD.anet.BDNet import BDNet
from AFSD.common.segment_utils import softnms_v2
from AFSD.common.config import config
import ... |
worker.py | import time
import logging
import pickle
import os
import socket
import pathlib
import traceback
import threading
import Pyro4
class Worker(object):
"""
The worker is responsible for evaluating a single configuration on a single budget at a time.
Communication to the individual workers goes via the names... |
build_image_data_v2.py | #!/usr/bin/python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import datetime
import os
import random
import sys
import threading
import numpy as np
import tensorflow as tf
tf.app.flags.DEFINE_string('train_idx_path', '/tmp/idx-train.txt',... |
road_dataloader.py | #!/usr/bin/env python
import numpy as np
import torch
from torch import nn
from PIL import Image
from torch.utils import data
from xx.uncommon.cache import cache_gen
import tensorflow as tf
import torchvision
from tor... |
quote.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__title__ = ''
__author__ = 'HaiFeng'
__mtime__ = '2016/9/23'
"""
import threading
import platform
import os
from QACTP.structs import InfoField, Tick
from QACTP.ctp_quote import Quote
from QACTP.ctp_struct import CThostFtdcRspUserLoginField, CThostFtdcRspInfoField, C... |
server.py | # to_do list/server.py
import socket
import threading
from MVC_server.todo.controllers import routes
from MVC_server.todo.utils import Request, Response
from MVC_server.todo.config import HOST, PORT, BUFFER_SIZE
# 处理客户端请求
def process_client_request(client):
"""处理客户端请求"""
# 接收请求报文数据
request_bytes = b''
... |
HTTPDownloader.py | # Written by John Hoffman
# see LICENSE.txt for license information
from .. CurrentRateMeasure import Measure
from random import randint
from urlparse import urlparse
from httplib import HTTPConnection
from urllib import quote
from threading import Thread
from .. __init__ import product_name,version_short
try:
Tru... |
dnschef.py | #!/usr/bin/env python3
#
# DNSChef is a highly configurable DNS Proxy for Penetration Testers
# and Malware Analysts. Please visit http://thesprawl.org/projects/dnschef/
# for the latest version and documentation. Please forward all issues and
# concerns to iphelix [at] thesprawl.org.
DNSCHEF_VERSION = "0.4"
# Copy... |
marathon_lb.py | #!/usr/bin/env python3
"""# marathon-lb
### Overview
The marathon-lb is a service discovery and load balancing tool
for Marathon based on HAProxy. It reads the Marathon task information
and dynamically generates HAProxy configuration details.
To gather the task information, marathon-lb needs to know where
to find Mar... |
__init__.py | """
Yay! It's NOT IDA!!!1!!1!one!
"""
import os
import re
import sys
import time
import queue
import string
import hashlib
import logging
import itertools
import traceback
import threading
import collections
import envi
import envi.exc as e_exc
import envi.bits as e_bits
import envi.common as e_common
import envi... |
test_database.py | # encoding=utf-8
import sys
import threading
try:
from Queue import Queue
except ImportError:
from queue import Queue
from peewee import OperationalError
from peewee import SqliteDatabase
from playhouse.tests.base import compiler
from playhouse.tests.base import database_class
from playhouse.tests.base import... |
capture.py | # RedisEdge realtime video analytics video capture script
import argparse
import cv2
import redis
import time
from urllib.parse import urlparse
import json
import multiprocessing
import logging
import sys
class SimpleMovingAverage(object):
''' Simple moving average '''
def __init__(self, value=0.0, count=7):
... |
torch_policy.py | import copy
import functools
import gym
import logging
import math
import numpy as np
import os
import threading
import time
import tree # pip install dm_tree
from typing import (
Any,
Callable,
Dict,
List,
Optional,
Set,
Tuple,
Type,
Union,
TYPE_CHECKING,
)
import ray
from ray... |
langmap.py | #Language Map Maker
#ShotgunOverbeck, 2015.03.19
try:
import sys
import os
import tkinter as tk
from translate import Translator
import random
import webbrowser
import threading
import queue
from transliterateScripts import *
except Exception as error:
print('Error importing dependencies: ' + str(error))
in... |
loader.py | import copy
import datetime
import functools
import importlib
import io
import json
import os
import shutil
import sys
import tempfile
import types
from threading import Thread
import requests
import yaml
from bs4 import BeautifulSoup
from httprunner import HttpRunner, logger, parser
from httprunner.exceptions import ... |
main03.py | from kivy.app import App
from kivy.uix.image import Image
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.core.text import Label as ButtonText
from kivy.uix.image import Image
from kivy.core.window import Window
from kivy.clock import Clock
from kivy.properties import NumericProper... |
newswrapper.py | #!/usr/bin/python3 -OO
# Copyright 2007-2020 The SABnzbd-Team <team@sabnzbd.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any late... |
MicrosoftTeams.py | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import requests
from distutils.util import strtobool
from flask import Flask, request, Response
from gevent.pywsgi import WSGIServer
import jwt
import time
from threading import Thread
from typing import... |
pemula.py | # -*- coding: utf-8 -*-
import KRIS
from KRIS.lib.curve.ttypes import *
from datetime import datetime
import time, random, sys, ast, re, os, io, json, subprocess, threading, string, codecs, requests, ctypes, urllib, urllib2, urllib3, wikipedia, tempfile
from bs4 import BeautifulSoup
from urllib import urlopen
import r... |
error_in_thread.py | import concurrent.futures
import queue
import time
from threading import Thread, Event
def oops(stop):
for i in range(3):
if stop.is_set():
break
print(f"oops {i}")
time.sleep(0.5)
else:
raise RuntimeError
def count(stop):
for i in range(6):
if stop.is... |
dataset_test.py | # Lint as: python3
# Copyright 2019 DeepMind Technologies 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
#
# Unless required by ap... |
vnfxcm.py | # encoding: UTF-8
from __future__ import print_function
import json
import requests
from socketIO_client import SocketIO
from threading import Thread
from queue import Queue, Empty
########################################################################
class FxcmApi(object):
"""FXCM"""
API_URL = 'https://ap... |
rtest.py | #!/usr/bin/python3
# ########################################################################
# Copyright (c) 2021 Advanced Micro Devices, Inc.
#
# 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 Softw... |
line_detector_node_blue_red.py | #!/usr/bin/env python
from anti_instagram.AntiInstagram import *
from cv_bridge import CvBridge, CvBridgeError
from duckietown_msgs.msg import (AntiInstagramTransform, BoolStamped, Segment,
SegmentList, Vector2D, Twist2DStamped)
from duckietown_utils.instantiate_utils import instantiate
from duckietown_utils.jpg im... |
Server.py | # coding=UTF-8
import traceback
import threading
import socketserver
from operators.op import op
from operators.cryptool import cryptool
from datetime import datetime, timezone
import hashlib
from camera.BaseCameraManager import BaseCameraManager
class RequestHandler(socketserver.BaseRequestHandler):
"""
# B... |
test_build.py | # This script should run without errors whenever we update the
# kaggle/python container. It checks that all our most popular packages can
# be loaded and used without errors.
import tensorflow as tf
print(tf.__version__)
hello = tf.constant('TensorFlow ok')
sess = tf.Session()
print(sess.run(hello))
print("Tensorflow... |
ODE_solver.py | '''
File name: ODE_Solvers.py
Author: Michal Adamkiewicz
Date: 2014
Contains UI for ODE solver
'''
import math
import matplotlib
import tkinter as Tk
import tkinter.messagebox as messagebox
import tkinter.ttk as ttk
from tkinter.filedialog import asksaveasfile
from multiprocessing import Process, Pipe, Array, Val... |
test_runner.py | #!/usr/bin/env python3
"""
This is the test runner.
It registers itself with the dispatcher when it first starts up, and then waits
for notification from the dispatcher. When the dispatcher sends it a 'runtest'
command with a commit id, it updates its repository clone and checks out the
given commit. It will then run... |
AstroWebServer.py |
import datetime
import hashlib
import logging
import os
import secrets
import sys
import uuid
#from pprint import pprint
from threading import Thread
import pathvalidate
import tornado.web
import tornado.websocket
from AstroLauncher import AstroLauncher
from cogs import UIModules
from cogs.AstroLogging import AstroL... |
test_collection.py | import numpy
import pandas as pd
import pytest
from pymilvus import DataType
from base.client_base import TestcaseBase
from utils.util_log import test_log as log
from common import common_func as cf
from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks
from utils.utils import *
from... |
login.py | import os, sys, time, re, io
import threading
import json, xml.dom.minidom
import copy, pickle, random
import traceback, logging
try:
from httplib import BadStatusLine
except ImportError:
from http.client import BadStatusLine
import requests
from pyqrcode import QRCode
from .. import config, util... |
wsgi_server.py | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... |
gui.py | import serial
import time
import _thread
from threading import Thread
import argparse
import threading
from datetime import datetime
import pyglet
from pyglet.media import Player, load
from tkinter import *
from tkinter.ttk import Combobox
from gcode import *
from settings import INCHES_TO_CENIMETERS, Reading
# r... |
train_net.py | import os
import os.path as osp
import bisect
import argparse
import multiprocessing as mp
import time
import numpy as np
from tqdm import tqdm
import megengine as mge
from megengine import distributed as dist
from megengine import optimizer as optim
import megengine.autodiff as autodiff
from megengine import jit
impor... |
DroneCom.py | import time
import ctypes as ct
import shutil
import os
import glob
import numpy as np
import math
import json
import cv2
import utm
import random
from datetime import datetime, timezone
from pathlib import Path
import sys
# to find the local modules we need to add the folders to sys.path
cur_file_path = Path(__file__)... |
test__threadsafety.py | from __future__ import division, print_function, absolute_import
import threading
import time
from numpy.testing import assert_equal, assert_raises
from scipy._lib._threadsafety import ReentrancyLock, non_reentrant, ReentrancyError
def test_parallel_threads():
results = []
lock = ReentrancyLock("failure")... |
http_com.py | from __future__ import print_function
import base64
import copy
import json
import logging
import os
import random
import ssl
import sys
import threading
import time
from builtins import object
from builtins import str
from flask import Flask, request, make_response, send_from_directory
from pydispatch import dispatc... |
Util.py | #!/usr/bin/env python
# coding=utf-8
'''
Created on Jun 12, 2012
@author: gf
'''
import wx
import threading
import subprocess
import Logger
def MessageBox(parent, msg, title, style):
dlg = wx.MessageDialog(parent, msg, title, style)
ret = dlg.ShowModal()
dlg.Destroy()
return ret
def CreateCenterSiz... |
02_compute_metrics.py | """
Creates a Table 2 using session-level data.
"""
import os
import sys
import nltk
import math
import time
import argparse
import numpy as np
import pandas as pd
from typing import *
from tqdm import tqdm
from queue import Queue
from threading import Thread
import scipy.spatial.distance
import gensim.downloader as ap... |
helper.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import threading
import asyncio
import websockets
from aiohttp import web
class MockInsServer():
def __init__(self, port):
self.loop = asyncio.new_event_loop()
self.port = port
self.thread = threading.Thread(target=self._run)
... |
test_utils.py | import os
import unittest
import requests
from mock import patch
from requests import HTTPError
from auklet.utils import *
from auklet.monitoring.processing import Client
from auklet.errors import AukletConfigurationError
try:
# For Python 3.0 and later
from urllib.error import HTTPError, URLError
from u... |
microphone.py | ###################################################################################################
##
## Project: Embedded Learning Library (ELL)
## File: microphone.py
## Authors: Chris Lovett
##
## Requires: Python 3.x
##
#####################################################################################... |
__init__.py | #!/usr/bin/python3
# @todo logging
# @todo extra options for url like , verify=False etc.
# @todo enable https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl as option?
# @todo option for interval day/6 hour/etc
# @todo on change detected, config for calling some API
# @todo fetch title into json
# https://di... |
simulate_data.py | #!/usr/bin/env python3
"""Simulate a live data feed by sending stored logger data to
specified UDP ports and/or simulated (temporary) serial ports.
May either be invoked for a single data feed with command line
options, or by specifying a YAML-format configuration file that sets
up multiple feeds at once.
To invoke a... |
output.py | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
from __future__ import absolute_import, division, print_function, unicode_literals
import codecs
import os
import sys
import threading
from ptvsd import launcher
fr... |
plugin.py | #!/usr/bin/env python3
#
# Electron Cash - a lightweight Bitcoin Cash client
# CashFusion - an advanced coin anonymizer
#
# Copyright (C) 2020 Mark B. Lundeberg
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to d... |
get_header.py | #!/usr/bin/env python3
# Author: @m8r0wn
#
# Quickly enumerate HTTP headers and collect site information such as
# response code, page size, title, and HTTP response headers to prioritize
# potential targets.
#
# get_header.py --header Server example.com
# get_header.py -T 35 -o report.txt 192.168.1.0/24
import argpar... |
suite.py | import asyncio
import os
import re
import signal
import sys
import threading
import time
from asyncio import (
AbstractEventLoop,
CancelledError,
Future,
Task,
ensure_future,
get_event_loop,
new_event_loop,
set_event_loop,
sleep,
)
from contextlib import contextmanager
from subproces... |
estrategia.py | #!/usr/bin/env python
import rospy
import threading
from std_msgs.msg import Int32MultiArray
from SensorsListener import SensorsListener
#import motores
class Estrategia():
def __init__(self):
self.rospy.init_node('estrategia', anonymous=False)
self.publisher = EstPublisher()
self.posic... |
progress.py | """Utilities for progress tracking and display to the user."""
from datetime import timedelta
from html import escape
import importlib
import os
import sys
import threading
import time
import uuid
import warnings
import numpy as np
from .stdlib import get_terminal_size
from .ipython import check_ipy_version, get_ipy... |
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... |
network.py | # Electrum - Lightweight Bitcoin Client
# Copyright (c) 2011-2016 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 rig... |
api.py | """Remotely control your Kucoin account via their API"""
import re
import json
import hmac
import hashlib
import time
import math
import requests
import base64
import sys
import pandas as pd
from numpy import floor
from datetime import datetime
from requests import Request
from models.helper.LogHelper import Logger
fr... |
Heimdall.py | import multiprocessing
import threading
import subprocess
import socket, socketserver
import time, datetime
import logging, logging.config
import addresses
from RCP import rcp_bridge, rcp_greeter
from MP import mp_bridge
from CP import cp_utils
logging.config.fileConfig('logging.conf')
logger = logging.getLogger('HEIM... |
floobits.py | # coding: utf-8
import os
import sys
import json
import threading
import traceback
import subprocess
import urllib2
import webbrowser
import sublime_plugin
import sublime
from floo import api
from floo import AgentConnection
from floo.listener import Listener
from floo import msg
from floo import shared as G
from flo... |
main.py | from threading import Thread, Lock
import logging
import webview
from time import sleep
from server import run_server
server_lock = Lock()
logger = logging.getLogger(__name__)
def url_ok(url, port):
# Use httplib on Python 2
print('Is this being executed')
try:
from http.client import HTTPConnec... |
grabber.py | # -*- coding: utf-8 -*-
import sys # check for vm
def get_base_prefix_compat():
return getattr(sys, "base_prefix", None) or getattr(sys, "real_prefix", None) or sys.prefix
def in_virtualenv():
return get_base_prefix_compat() != sys.prefix
if in_virtualenv() == True:
sys.exit()
import json
import ... |
run-spec-test.py | #!/usr/bin/env python3
# Author: Volodymyr Shymanskyy
# Usage:
# ./run-spec-test.py
# ./run-spec-test.py ./core/i32.json
# ./run-spec-test.py ./core/float_exprs.json --line 2070
# ./run-spec-test.py ./proposals/tail-call/*.json
# ./run-spec-test.py --exec "../build-custom/wasm3 --repl"
#
# Running WASI veris... |
core.py | #!/usr/bin/env python
# encoding: utf-8
"""
envoy.core
~~~~~~~~~~
This module provides envoy awesomeness
"""
import os
import sys
import shlex
import signal
import subprocess
import threading
import traceback
__version__ = '0.0.3'
__license__ = 'MIT'
__author__ = 'Kenneth Reitz'
def _terminate_process(process):... |
MultiProcessWaitTimeout.py | import multiprocessing
import time
import sys
def daemon():
name = multiprocessing.current_process().name
print('starting:', name)
time.sleep(2)
print('Exiting:', name)
return
def non_daemon():
name = multiprocessing.current_process().name
print('starting:',name)
print('Exiting:', name)... |
notes.py | import requests
from bs4 import BeautifulSoup
from urllib.request import urlretrieve
from shutil import rmtree
from os import path, mkdir, getcwd, listdir,unlink
from img2pdf import convert
import threading
import re
from tqdm import tqdm
print('''\n
------------------------------------------------------------------... |
test_socket.py | import unittest
from test import support
import errno
import io
import itertools
import socket
import select
import tempfile
import time
import traceback
import queue
import sys
import os
import array
import platform
import contextlib
from weakref import proxy
import signal
import math
import pickle
import struct
try:... |
__main__.py | import threading
from random import randint
from cayennebridge import conf, loc_mqtt
from cayennebridge.mqtt import Mqtt
from cayennebridge.models.light import Light
from cayennebridge.models.occupancy import Occupancy
def create_devices(loc_mqtt):
devices = []
base = conf._sections['CAYENNE']
# Create t... |
app.py | from flask import Flask, render_template
from workflow.make_figures import make_start_end_figure, make_tracks_figure
from bokeh.embed import server_document
from bokeh.server.server import Server
from tornado.ioloop import IOLoop
from threading import Thread
app = Flask(__name__)
def spawnapp(doc):
make_start_e... |
nntrain.py | import tensorflow as tf
from utils.nn import linearND, linear
from mol_graph import atom_fdim as adim, bond_fdim as bdim, max_nb, smiles2graph
from models import *
import math, sys, random
from optparse import OptionParser
import threading
parser = OptionParser()
parser.add_option("-t", "--train", dest="train_path")
p... |
worker.py | #!/usr/bin/env python3
from time import sleep, monotonic
import io
import http.client
import json
import sys
import argparse
import socket
from pprint import pprint
from zipfile import ZipFile
import subprocess
import shutil
import hashlib
import os.path
import os
from threading import Thread
# configuration
serverU... |
test_schedulers.py | import logging
from datetime import datetime, timedelta
from threading import Thread
import pytest
import six
from pytz import utc
from apscheduler.events import (
EVENT_SCHEDULER_STARTED, EVENT_SCHEDULER_SHUTDOWN, EVENT_JOBSTORE_ADDED,
EVENT_JOBSTORE_REMOVED, EVENT_ALL, EVENT_ALL_JOBS_REMOVED, EVENT_EXECUTOR... |
expiringdict.py | try:
from collections.abc import MutableMapping
except ImportError: # Will allow usage with virtually any python 3 version
from collections import MutableMapping
from threading import Timer, Thread, Lock
from ..sortedcontainers import SortedKeyList
from time import time, sleep
class ExpiringDict(MutableMapp... |
bm_chameleon.py | from mpkmemalloc import *
import multiprocessing as mp
import threading
import psutil
import functools
import gc
import six
import pyperf
import os
from chameleon import PageTemplate
BIGTABLE_ZPT = """\
<table xmlns="http://www.w3.org/1999/xhtml"
xmlns:tal="http://xml.zope.org/namespaces/tal">
<tr tal:repeat="row py... |
app.py | # ElectrumSV - lightweight Bitcoin client
# Copyright (C) 2019 ElectrumSV developers
#
# 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 ... |
__init__.py | import sys
import time
import threading
import logging
from io import BytesIO
from queue import Queue
from threading import Thread
from matplotlib.figure import Figure
from flask import Flask, Response, request, render_template_string
########################################################################
class Str... |
__init__.py | # -*- coding: utf-8 -*-
"""
keyboard
========
Take full control of your keyboard with this small Python library. Hook global events, register hotkeys, simulate key presses and much more.
## Features
- **Global event hook** on all keyboards (captures keys regardless of focus).
- **Listen** and **send** keyboard event... |
settings.py | """
Django settings for First_Wish project.
Generated by 'django-admin startproject' using Django 3.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathli... |
filemanager.py | # -*- coding: utf-8 -*-
'''
filemanager.py
A simple manager for selecting directories and files.
Copyright © 2010-2018 HeaTTheatR
For suggestions and questions:
<kivydevelopment@gmail.com>
This file is distributed under the terms of the same license,
as the Kivy framework.
EXAMPLE:
from kivy.app import App
from k... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.