source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
imageme.py | #!/usr/bin/python
"""
imageMe is a super simple image gallery server.
Run imageme.py from the top level of an image directory to generate gallery
index HTML and run a SimpleHTTPServer on the localhost.
Imported as a module, use imageme.serve_dir(your_path) to do the same for any
directory programmatically. When run a... |
dg-SmartHome-cp.py | #from secure import NAME, TOKEN, TOPIC
import os
NAME = os.environ.get('NAME', None)
TOKEN = os.environ.get('TOKEN', None)
TOPIC = [os.environ.get('TOPIC_1', None), os.environ.get('TOPIC_2', None)]
URL_STR = os.environ.get('URL_STR', None)
HEROKU = os.environ.get('HEROKU', None)
import paho.mqtt.client as mqtt #pip in... |
cache_thread.py | # Copyright 2015, Pinterest, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
mapplot.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 use ... |
variable_scope.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... |
guider.py | import copy
import json
import math
import selectors
import socket
import threading
import time
class SettleProgress:
"""Info related to progress of settling after guiding starts or after
a dither
"""
def __init__(self):
self.Done = False
self.Distance = 0.0
self.SettlePx = 0.0... |
bhpnet.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 22 17:22:56 2020
@author: edoardottt
"""
import sys
import socket
import getopt
import threading
import subprocess
# define some global variables
listen = False
command = False
upload = False
execute = ""
target = ""
upload_destination = ""
port =... |
tcp_server.py | #! /data/sever/python/bin/python
# -*- coding:utf-8 -*-
"""
@author: 'root'
@date: '3/2/16'
"""
__author__ = 'root'
import socket
import threading
bind_ip = "0.0.0.0"
bind_port = 9999
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((bind_ip, bind_port))
server.listen(5)
print "Listen:%s" % ((... |
motor_lib.py | import re
import enum
import time
from threading import Thread
from roboclaw import Roboclaw
import maestro
DEFAULT_TIME_TO_DELAY_MOTOR = 0.02 # 20 milliseconds
MAX_MOTOR_SPEED = 100 # max speed from client
MAX_MOTOR_POWER = 120 # max power to bucket motor controller
MAX_DRIVE_MOTOR_RPM = 4000 # max rpm for to dr... |
MosaicTargetMaker.py | # The Leginon software is Copyright 2004
# The Scripps Research Institute, La Jolla, CA
# For terms of the license agreement
# see http://ami.scripps.edu/software/leginon-license
#
import re
import threading
import wx
from leginon.gui.wx.Entry import Entry, FloatEntry, IntEntry
import leginon.gui.wx.Node
from leginon... |
test_create_collection.py | import pdb
import copy
import logging
import itertools
import time
import threading
from multiprocessing import Process
import sklearn.preprocessing
import pytest
from utils import *
from constants import *
uid = "create_collection"
class TestCreateCollection:
"""
********************************************... |
screenControl.py | import screen_brightness_control as sbc
import time
from tkinter import *
from utility import *
import threading
import json
from tkinter.font import Font
from time import strftime
def fadeBrightness(fadeTo, interval = 0.5, increment = 1):
current = sbc.get_brightness()[0]
if fadeTo == current:
return ... |
ntds_parser.py | import sys, re, itertools, time
from binascii import hexlify
from threading import Thread, Event
from impacket.examples.secretsdump import LocalOperations, RemoteOperations, NTDSHashes
from impacket.smbconnection import SMBConnection, SessionError
from socket import error as socket_error
def process_remote(username,... |
process.py | import multiprocessing
from bs4 import BeautifulSoup, NavigableString, Comment
from lib.common import connectDB, oidList, log, strToDate, sectionName
import sys
import time
host = 'mongodb://user:eDltjgus2004!@192.168.35.153'
chunk = 500
maxProcessNo = 8
def parseNews(oid, processNo, parsedNo, startTime):
while ... |
main.py | import datetime
import os # os module is used to open files and run commands on the cmd and a lot of other features installation:deafult by python
import webbrowser
import cv2
import pyautogui
import pyttsx3 # pyttsx3 is module for text to speech installation:pip install pyttsx3
import requests
# speechrecogntion is ... |
example_binance_coin_futures.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_binance_coin_futures.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: http... |
plottingpanel.py | import threading
import warnings
import logging
import functools
import re
import darkdetect
from PyQt5 import QtGui, QtWidgets, QtCore
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
import matplotlib.pyplot as plt
import numpy as np
from app.resources import resources
from app.gui.d... |
AmongUsStats.py | import PySimpleGUIQt as sg
import winreg
import threading
import time
import datetime
import json
import requests
import subprocess
import os, os.path
import sys, glob
import psutil
# If the application is run as a bundle, the PyInstaller bootloader extends the sys module by a flag frozen=True and sets the app path in... |
randomGal.py | #randomGal.py
from astropy import units as u
from astropy import coordinates
from astroquery.ned import Ned
from astroquery.irsa_dust import IrsaDust
from astropy.coordinates import Angle,ICRS,SkyCoord
from astropy.coordinates.name_resolve import NameResolveError
import math
import os.path
import sys
import itertools... |
worker_process.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. 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 ... |
tcp_server.py | # -*- coding:utf8 -*-
import socket
import threading
import time
def tcplink(sock, addr):
print("accept new connection from %s:%s..." % addr)
sock.send("Welcom!".encode())
while True:
data = sock.recv(1024)
time.sleep(1)
if data == 'exit' or not data:
break
sock... |
Scripty.py | #!/usr/bin/env python3
# An open-source IDE for python, java, and C++
# By Jaden Arceneaux arceneauxJaden@gmail.com
# Feel free to change code as you feel
import sys
import os
# For running commands in the terminal
try:
from tkinter import *
from tkinter import messagebox
from tkinter import filedialog
ex... |
mp_process03-2.py | from multiprocessing import Process, Manager
def func(d, l):
d[1] = '1'
d['2'] = 2
d[0.25] = None
l.reverse()
if __name__ == '__main__':
with Manager() as manager:
d = manager.dict()
l = manager.list(range(10))
p = Process(target=func, args=(d, l))
p.start()
... |
shell.py | import logging
import subprocess
import threading
import typing
logger = logging.getLogger(__name__)
class BaseError(Exception):
pass
class SubprocessFailed(BaseError):
pass
def execute(args, *, env=None, verbose: int, command_alias: str) -> None:
buffer: typing.List[str] = []
lock_process_comple... |
cachingFileStore.py | # Copyright (C) 2015-2018 Regents of the University of California
#
# 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... |
perf-cs.py | """num_threads simulates the number of clients
num_requests is the number of http requests per thread
num_metrics_per_request is the number of metrics per http request
Headers has the http header. You might want to set X-Auth-Token.
Urls can be an array of the Monasca API urls. There is only one url in
it right now, bu... |
talk.py | # -*- coding: utf-8 -*-
from random import randint
from bs4 import BeautifulSoup
from wikiapi import WikiApi
from akad.ttypes import *
from kbbi import KBBI
from datetime import datetime, timedelta, date
from youtube_dl import YoutubeDL
from Aditya import Kaskus
from Aditya.AdityaMangakyo import *
import youtube_dl
fro... |
test_asyncore.py | import asyncore
import unittest
import select
import os
import socket
import sys
import time
import errno
import struct
from test import support
from io import BytesIO
try:
import threading
except ImportError:
threading = None
TIMEOUT = 3
HAS_UNIX_SOCKETS = hasattr(socket, 'AF_UNIX')
class dummysocket:
... |
mainwindow.py | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Spyder, the Scientific Python Development Environment
=====================================================
Developed and maintained by the Spyder Project
Contri... |
py_cli.py | """
This module privodes core algrithm to pick up proxy ip resources.
"""
import time
import threading
from utils import get_redis_conn
from config.settings import (
DATA_ALL, LOWEST_TOTAL_PROXIES)
from .core import IPFetcherMixin
__all__ = ['ProxyFetcher']
lock = threading.RLock()
class Strategy:
strategy... |
pipeline.py | # -*- coding:utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the ... |
fixtures.py | # coding: utf-8
# Original work Copyright Fabio Zadrozny (EPL 1.0)
# See ThirdPartyNotices.txt in the project root for license information.
# All modifications Copyright (c) Robocorp Technologies Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file e... |
decorator_util.py | # -*- coding: utf-8 -*-
import functools
import threading
# 装饰器模块
import time
from common_util import response_json
from utils.common_util import get_except
logger = logging.getLogger('django')
def myasync(func):
"""
实现函数异步执行
:param param1: this is a first param
:param param2: this is a... |
objects_processing.py | from datetime import datetime, timedelta
from threading import Thread
from time import sleep
from app.models import Object, ObjectStatusJob, Sensor, SensorStatusJob, SensorStatusSituation, ObjectStatusSituation, \
Report
from app.notifications import send_notification, send_notification_emergency
texts = {
'... |
baxter_mjc_env.py | # import matplotlib as mpl
# mpl.use('Qt4Agg')
import matplotlib.pyplot as plt
import numpy as np
import os
from threading import Thread
import time
import traceback
import sys
import xml.etree.ElementTree as xml
from tkinter import TclError
import pybullet as P
from dm_control.mujoco import Physics
from dm_control... |
Server.py | import socket
from threading import Thread
import random
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
ip_address = '127.0.0.1'
port = 5000
server.bind((ip_address, port))
server.listen()
clients = []
nicknames = []
questions = [
" What is the German word for Cheese? \n a.Mozarella\n b.Cheese\n c... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... |
__init__.py | from sbxpy.QueryBuilder import QueryBuilder as Qb
import aiohttp
import asyncio
import copy
import math
from threading import Thread
'''
:mod:`sbxpy` -- Main Library
===================================
.. module:: sbxpy
:platform: Unix, Windows
:synopsis: This is the module that use QueryBuilder to create all r... |
test_xmlrpc.py | import base64
import datetime
import sys
import time
import unittest
import xmlrpclib
import SimpleXMLRPCServer
import threading
import mimetools
import httplib
import socket
import os
from test import test_support
try:
unicode
except NameError:
have_unicode = False
else:
have_unicode = True
alist = [{'as... |
test_colored_logger.py | import io
import logging
import random
import six
import string
import unittest
from friendlylog import colored_logger as logger
from threading import Thread
# Tests cannot be executed in parallel due to the hack in the setUp method.
class TestColoredLogger(unittest.TestCase):
def setUp(self):
# Remove ... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "SERVER IS RUNNING !!"
def run():
app.run(host='0.0.0.0', port=8080)
def keep_alive():
t = Thread(target=run)
t.start()
|
app_preparation.py | #!/usr/bin/env python3
from threading import Thread
import importlib
from typing import List
import logging.handlers
import sys
from .modules.base_control import BaseControl, ControlConfiguration
from .dhcp_watchmen import DHCPWatchmen
LOG_LEVEL = logging.DEBUG
logger = logging.getLogger("elchicodepython.honeychec... |
test_executor.py | from __future__ import print_function, division, absolute_import
from operator import add
from collections import Iterator
from concurrent.futures import CancelledError
import itertools
from multiprocessing import Process
import sys
from threading import Thread
from time import sleep, time
import traceback
import m... |
decorators.py | import threading
from functools import wraps
from typing import Optional
from request_limiter.exceptions import LimitException
from request_limiter.strategy import LimitStrategy, LimitedIntervalStrategy
class RequestLimiterDecorator(object):
"""
A decorator class used to limit request rate to a function usin... |
test_sw_WiFiServer.py | from mock_decorators import setup, teardown
from threading import Thread
import socket
import time
stop_client_thread = False
client_thread = None
@setup('Simple echo server')
def setup_echo_server(e):
global stop_client_thread
global client_thread
def echo_client_thread():
time.sleep(1) # let som... |
httpd.py | #!/usr/bin/env python
"""
Copyright (c) 2014-2019 Miroslav Stampar (@stamparm)
See the file 'LICENSE' for copying permission
"""
import BaseHTTPServer
import cStringIO
import datetime
import httplib
import glob
import gzip
import hashlib
import io
import json
import mimetypes
import os
import re
import socket
import ... |
curl_grading.py | """curl_grading.py: tools for analyzing and checking C++ and Py programs"""
import subprocess as sub
import difflib
import unittest
import re
import tokenize
import dis
import io
import cpplint
import sys
import pycodestyle
import logging
import os
import random
import importlib
import multiprocessing
from io import St... |
sanitylib.py | #!/usr/bin/env python3
# vim: set syntax=python ts=4 :
#
# Copyright (c) 2018 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import contextlib
import string
import mmap
import sys
import re
import subprocess
import select
import shutil
import shlex
import signal
import threading
import concurrent.fu... |
unit_tests.py | from __future__ import print_function
from database_api import DatabaseAPI
from index_service import IndexService, Indexer, Parser
import multiprocessing as mp
from twisted.web import server, resource
from twisted.internet import reactor
import requests
import json
import config
class DatabaseAPI_test:
''... |
Misc.py | ## @file
# Common routines used by all tools
#
# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the lic... |
test_cpp_extensions_jit.py | # Owner(s): ["module: cpp-extensions"]
import os
import shutil
import sys
import unittest
import warnings
import re
import tempfile
import subprocess
import glob
import textwrap
from multiprocessing import Process
import torch.testing._internal.common_utils as common
import torch
import torch.backends.cudnn
import t... |
door.py | """Database module."""
from os import environ
from contextlib import contextmanager, AbstractContextManager
from typing import Callable
import logging
from threading import Thread
from time import sleep
from const import(
COMMAND_PAYLOAD
,STATUS_PAYLOAD
)
build_type = environ.get('BUILD_TYPE', None)
print(f... |
test_io.py | import numpy as np
import numpy.ma as ma
from numpy.ma.testutils import *
from numpy.testing import assert_warns
import sys
import gzip
import os
import threading
from tempfile import mkstemp, NamedTemporaryFile
import time
from datetime import datetime
from numpy.lib._iotools import ConverterError, ConverterLockEr... |
Dapars2_Multi_Sample.py | import numpy as np
import os
import sys
import datetime
import threading
import scipy as sp
import scipy.stats
from multiprocessing import Pool
from bisect import bisect
import math
import time
import multiprocessing
def time_now():#return time
curr_time = datetime.datetime.now()
return curr_time.strftime("... |
coverage_test_multicast.py | from queue import Queue
import random
import threading
import unittest
from coapclient import HelperClient
from coapserver import CoAPServer
from coapthon import defines
from coapthon.messages.message import Message
from coapthon.messages.option import Option
from coapthon.messages.request import Request
from coapthon.... |
main.py | from gpio import setup_gpio
from gpio import close_gpio
from climate import Climate
from state import HouseState
from control import mqtthread
from control import sensor_pollings
from control import register_device
from control import handle_button
from control import toggle_client_output
from control import toggle_ala... |
CnC.py | import socket
from threading import Thread
import time
threads = []
clients = []
def listen_for_bots(port):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(("", port))
sock.listen()
bot, bot_address = sock.accept()
clients.append(bot)
def main():
print("[+] Server bot w... |
terminal.py | import sys
import time
import logging
from threading import Thread
import urwid
from .leetcode import Leetcode, Quiz
from views.home import HomeView
from views.detail import DetailView
from views.help import HelpView
from views.loading import *
from views.viewhelper import *
from views.result import ResultView
from .co... |
lektor_scss.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sass
import errno
import re
from lektor.pluginsystem import Plugin
from termcolor import colored
import threading
import time
COMPILE_FLAG = "scss"
class scssPlugin(Plugin):
name = u'Lektor scss'
description... |
test_autograd.py | # Owner(s): ["module: autograd"]
import contextlib
import gc
import io
import math
import os
import random
import sys
import tempfile
import threading
import time
import unittest
import uuid
import warnings
import operator
from copy import deepcopy
from collections import OrderedDict
from itertools import product
from... |
gui.py | from tkinter import *
from tkinter.ttk import Progressbar
import tkinter.messagebox
from tkinter.ttk import Progressbar, Style, Button
import cv2, os
from tkinter import filedialog
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from PIL import ImageTk, Image
from inference import SurvedMode... |
threaded_runner.py | # Copyright 2017 reinforce.io. 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... |
runner.py | from IPython.display import display
import ipywidgets as widgets
import subprocess
import argparse
import sys
import time
import threading
from .logview import LogView
from .logfile import LogFile
def run_script(script):
"""
Run script via Python API.
It is an internal testing API.
"""
runner = Ru... |
mapd.py | #!/usr/bin/env python3
# Add phonelibs openblas to LD_LIBRARY_PATH if import fails
from scipy import spatial
#DEFAULT_SPEEDS_BY_REGION_JSON_FILE = BASEDIR + "/selfdrive/mapd/default_speeds_by_region.json"
#from selfdrive.mapd import default_speeds_generator
#default_speeds_generator.main(DEFAULT_SPEEDS_BY_REGION_JSON... |
test_index.py | import logging
import time
import pdb
import copy
import threading
from multiprocessing import Pool, Process
import numpy
import pytest
import sklearn.preprocessing
from utils.utils import *
from common.constants import *
uid = "test_index"
BUILD_TIMEOUT = 300
field_name = default_float_vec_field_name
binary_field_nam... |
get_proxy.py | # -*- coding: utf-8 -*-
"""
Created on Tue Dec 12 10:10:46 2017
@author: LZR
"""
import requests
from lxml import etree
import threading #多线程处理与控制
import time
base_url = 'http://www.xicidaili.com/wt/'
headers = {
'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0'
... |
test_dag_serialization.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... |
UpdateButton.py | import os
import sys
from PyQt5.QtWidgets import QLabel
import logging
from Parents import Button
import pkg_resources
import json
import sys
from urllib import request
from pkg_resources import parse_version
import threading
class UpdateButton(Button):
def __init__(self, parent):
super(UpdateButton, self).... |
cmd_helper.py | # Copyright (c) 2012 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.
"""A wrapper for subprocess to make calling shell commands easier."""
import logging
import os
import pipes
import select
import signal
import string
im... |
gshard_decode.py | # Lint as: python3
# Copyright 2020 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 ... |
events_monitor.py | # Copyright 2020 Ocean Protocol Foundation
# SPDX-License-Identifier: Apache-2.0
import logging
import os
import time
import lzma as Lzma
import json
from json import JSONDecodeError
from threading import Thread
from datetime import datetime
import elasticsearch
import requests
from eth_utils import remove_0x_prefix... |
tests.py | """
Unit tests for reverse URL lookups.
"""
import sys
import threading
from admin_scripts.tests import AdminScriptTestCase
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
from django.http import (
HttpRequest, ... |
web.py | import BaseHTTPServer, SimpleHTTPServer
import ssl
import tempfile
import os
import AESCipher
import mycerts
import threading
import time
from urlparse import urlparse, parse_qs
import json
import subprocess
aes = AESCipher.AESCipher('Content-type: text/json') # Guess what's this? :-)
server_crt_file = tempfile.Named... |
ssh_cracker.py | import threading
from threading import Thread
import time
import argparse
from pexpect import pxssh
import nmap
Found = False
Fails = 0
maxConnections = 5
connection_lock = threading.BoundedSemaphore(maxConnections)
def help():
print ("author to show author name")
print ("help to... |
__init__.py | # -*- coding: utf-8 -*-
'''
Set up the Salt integration test suite
'''
# Import Python libs
from __future__ import absolute_import, print_function
import os
import re
import sys
import copy
import time
import stat
import errno
import signal
import shutil
import pprint
import atexit
import socket
import logging
import... |
select_ticket_info.py | # -*- coding=utf-8 -*-
import datetime
import random
import os
import socket
import sys
import threading
import time
import TickerConfig
import wrapcache
from agency.cdn_utils import CDNProxy, open_cdn_file
from config import urlConf, configCommon
from config.TicketEnmu import ticket
from config.configCommon import sea... |
main.py | import multiprocessing
for bot in ('dankmemerSend', 'dankmemerReact'):
p = multiprocessing.Process(target=lambda: __import__(bot))
p.start()
|
test_start_vrs_simultaneously.py | '''
Test stop all vrs, then start them simultaneously
@author: Youyk
'''
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.operations.config_operations as con_ops
import zstackwoodpecker.operations.vm_operations as vm_ops
import zstackwoodpecker.operations.net_operations as net_... |
__init__.py | # -*- coding: utf-8 -*-
from binaryninja import *
from qirawebsocket import *
import threading
import time
import os
wsserver = None
msg_queue = []
bv = None
def plugin_start(asdf, function):
global bv
bv = asdf
#sync_ninja_comments()
threading.Thread(target=start_server).start()
def handle_message_q... |
managers.py | #
# Module providing the `SyncManager` class for dealing
# with shared objects
#
# multiprocessing/managers.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token' ]
#
# Imports
#
import sys
import threading
import ar... |
multithread.py | import threading
import time
def long_time_task(i):
print('Current sub_thread: {} Task {}'.format(threading.current_thread().name, i))
time.sleep(2)
print("Result: {}".format(8 ** 20))
if __name__=='__main__':
start = time.time()
print('This is main thread:{}'.format(threading.current_thread().n... |
example_userdata_stream_new_style.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_userdata_stream_new_style.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api
# Documentation: https://lucit-systems-and-development.github.io/unicorn-binance-web... |
email.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 29 15:35:50 2020
@author: rohithbhandaru
"""
from threading import Thread
from flask import current_app
from flask_mail import Message
from . import mail
def send_async_email(appContext, msg):
with appContext.app_context():
mail.sen... |
run_agent.py | import sys
import os
import numpy as np
import copy
from flask import Flask, request, jsonify
from queue import PriorityQueue
from threading import Thread
# Agent
from convlab2.dialog_agent import PipelineAgent, BiSession
from convlab2.nlu.milu.multiwoz import MILU
from convlab2.dst.rule.multiwoz import RuleDST
from... |
event_processor.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
test_pool_test.py | #!/usr/bin/env python3
import pytest
from threading import Thread
import time
from contextlib import ExitStack
import pyresourcepool.pyresourcepool as rp
class Person(object):
def __init__(self, name):
self.name = name
def do_callback_upper(obj):
time.sleep(1)
obj.name = obj.name.upper()
def ... |
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 ... |
Hiwin_RT605_ArmCommand_Socket_20190627194540.py | #!/usr/bin/env python3
# license removed for brevity
import rospy
import os
import socket
##多執行序
import threading
import time
import sys
import matplotlib as plot
import HiwinRA605_socket_TCPcmd as TCP
import HiwinRA605_socket_Taskcmd as Taskcmd
import numpy as np
from std_msgs.msg import String
from ROS_Socket.srv imp... |
utils.py | from timeit import default_timer as timer
import multiprocessing as mp
import math
class TicToc():
def __init__(self):
self.t = None
self.results = {}
def tic(self):
self.t = timer()
def toc(self, name):
if self.t is None:
raise RuntimeError('Timer not started'... |
helpers.py | '''
Authors: Jared Galloway, Jeff Adrion
'''
from iai.imports import *
from iai.sequenceBatchGenerator import *
#-------------------------------------------------------------------------------------------
def log_prior(theta):
''' The natural logarithm of the prior probability. '''
lp = 0.
# unpack the... |
add_pub_year.py | #########################################################################################################################################
# IMPORTS ###############################################################################################################################
from elasticsearch import Elasticsearch as E... |
musca.py | import time
from contextlib import suppress
from threading import Thread, Lock
from astropy import units as u
from panoptes.utils import error
from panoptes.utils.time import CountdownTimer
from panoptes.utils.utils import get_quantity_value
from panoptes.pocs.dome.abstract_serial_dome import AbstractSerialDome
cl... |
daemonhttp.py |
#
# Imports
#
import configparser
import json
import logging
import raspberrypi
import threading
import time
import signal
from http.server import HTTPServer, SimpleHTTPRequestHandler
from http import HTTPStatus
from urllib.parse import urlparse, parse_qs
class Config:
def __init__(self, filename, default={}):
... |
decoding_unit_test.py | # Copyright (c) 2020-2021, NVIDIA CORPORATION. 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 ... |
detector_utils.py | # Utilities for object detector.
import numpy as np
import sys
import tensorflow as tf
import os
from threading import Thread
from datetime import datetime
import cv2
from utils import label_map_util
from collections import defaultdict
detection_graph = tf.Graph()
sys.path.append("..")
# score threshold for showing... |
automated_gui.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat May 25 02:21:40 2019
@author: kenneth
"""
import time
from STOCK import stock
import os
import requests
import numpy as np
import pandas as pd
import tkinter as tk
from tkinter import ttk
from oandapyV20 import API
from mpl_finance import candlestick2_o... |
test_lightmodules.py | import http.server
import metricbeat
import os
import os.path
import platform
import shutil
import sys
import threading
import unittest
import json
from contextlib import contextmanager
class Test(metricbeat.BaseTest):
@unittest.skipIf(platform.platform().startswith("Windows-10"),
"flaky tes... |
editor_test.py | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import pytest
from _pytest.skipping import pytest_runtest_setup as skipping_pytest_runtest_setup
import inspec... |
main.py | import atexit
import multiprocessing as mp
import json
import signal
import sys
import time
from relay import argparse_shared as at
from relay.runner import main as relay_main, build_arg_parser as relay_ap
from relay_mesos import log
from relay_mesos.util import catch
from relay_mesos.scheduler import Scheduler
def ... |
DEM_run_all_benchmarks_grid.py | from __future__ import print_function
import os
import subprocess
import sys
import multiprocessing as mp
import queue
from threading import Thread
import threading
from glob import glob
import shutil
import KratosMultiphysics.kratos_utilities as kratos_utils
kratos_benchmarking_path = os.path.join('..','..','..','be... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.