source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
wurlitzer.py | """Capture C-level FD output on pipes
Use `wurlitzer.pipes` or `wurlitzer.sys_pipes` as context managers.
"""
from __future__ import print_function
__version__ = '2.1.1.dev'
__all__ = [
'pipes',
'sys_pipes',
'sys_pipes_forever',
'stop_sys_pipes',
'Wurlitzer',
]
import ctypes
import errno
import ... |
agent_run.py | from collections import deque
from threading import Thread
from dataclasses import dataclass
import cv2
import settings
import os
import time
import numpy as np
import tensorflow as tf
import keras.backend.tensorflow_backend as backend
from sources import CarlaEnv, STOP, ACTIONS_NAMES
# Image types
@dataclass
class A... |
configure_and_test_integration_instances.py | from __future__ import print_function
import argparse
import logging
import os
import uuid
import json
import ast
import subprocess
import sys
import zipfile
from datetime import datetime
from enum import IntEnum
from time import sleep
from threading import Thread
from distutils.version import LooseVersion
from demis... |
dam.py | import threading
import time
def daemon():
print("daemon thread start")
time.sleep(2)
print("Finishing daemon thread")
def normalthread():
print("Regular thread start")
print("Regular thread end")
d = threading.Thread(target=daemon, name="daemon", daemon=True)
n = threading.Thread(target=normalthr... |
workbench.py | # -*- coding: utf-8 -*-
import ast
import collections
import importlib
import logging
import os.path
import pkgutil
import platform
import queue
import re
import shutil
import socket
import sys
import tkinter as tk
import tkinter.font as tk_font
import traceback
from threading import Thread
from tkinter import message... |
myproxy.py | import os
import sys
import socket
import threading
def hexdump(src, length=16):
result = []
digits = 4 if isinstance(str, unicode) else 2
for i in xrange(0, len(str), length):
s = src[i:i+length]
hexa = b' '.join(["%0*X" % (digits, ord(x)) for x in s])
text = b''.join([x if 0x... |
controller.py | import numpy as np
import math
import time
import threading
class Controller_AI():
def __init__(self, get_state, get_time, actuate_motors, params, quad_identifier, get_motor_speeds):
self.get_motor_speeds = get_motor_speeds
self.quad_identifier = quad_identifier
self.actuate_motors = actuat... |
recorder.py | # Software License Agreement (BSD License)
#
# Copyright (c) 2009, Willow Garage, 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 source code must retain the above... |
MotionDetector.py | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 21 20:39:54 2022
@author: starx
"""
import numpy as np
import cv2
import time
import datetime
from threading import Thread
"""
MotionDetection Class, allows to detect camera motions:
path: where you want to save your files
video_source: numeric value of camera c... |
__init__.py | """
* Experimental *
Like the map function, but can use a pool of threads.
Really easy to use threads. eg. tmap(f, alist)
If you know how to use the map function, you can use threads.
"""
from __future__ import print_function
__author__ = "Rene Dudfield"
__version__ = "0.3.0"
__license__ = 'Python license'
impor... |
plugin.py | ###
# Copyright (c) 2002-2004, Jeremiah Fincher
# Copyright (c) 2008-2010, James McCoy
# Copyright (c) 2014, Valentin Lorentz
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistribution... |
startup_flair.pyw | import time, os, threading as thread, pathlib
from tkinter import *
from PIL import Image, ImageTk
PATH = str(pathlib.Path(__file__).parent.absolute())
os.chdir(PATH)
scalar = 0.6
def doAnimation():
root = Tk()
root.configure(bg='black')
root.frame = Frame(root, borderwidth=2, relief=RAISED)
... |
enum_script.py | #!/usr/bin/env python
import subprocess
import sys
import os
import multiprocessing
import socket
class Bcolors:
"""This Class is used to modify the output colors
"""
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
ENDC = '\033[0m'
def ... |
client.py | # client.py
#
# Common client. Measure the response rate of the echo server
from socket import *
import time
from threading import Thread
import atexit
import sys
if len(sys.argv) > 1:
MSGSIZE = int(sys.argv[1])
else:
MSGSIZE = 1
msg = b'x'*MSGSIZE
sock = socket(AF_INET, SOCK_STREAM)
sock.connect(('localhos... |
test_ssl.py | # Test the support for SSL and sockets
import sys
import unittest
from test import support
import socket
import select
import time
import datetime
import gc
import os
import errno
import pprint
import tempfile
import urllib.request
import traceback
import asyncore
import weakref
import platform
import re
import functo... |
resolver.py | import struct
import socket
import datetime
import struct
from threading import Lock, Thread
from server import BaseServer, BUFFER_SIZE
from cache import Cache, get_qname, set_padding
from random import randint
TYPES = {
1: 'A', 2: 'NS', 3: 'MD', 4: 'MF', 5: 'CNAME',
6: 'SOA', 7: 'MB', 8: 'MG', 9: 'MR', 10... |
test_util.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... |
okexGateway.py | # encoding: UTF-8
'''
vnpy.api.okex的gateway接入
注意:
1. 目前仅支持USD现货交易
'''
from __future__ import print_function
import os
import json
from datetime import datetime
from time import sleep
from copy import copy
from threading import Condition
from Queue import Queue
from threading import Thread
from time import sleep
fro... |
drowsiness_detector.py |
# coding: utf-8
# In[1]:
import numpy as np
import imutils
import time
import timeit
import dlib
import cv2
import matplotlib.pyplot as plt
from scipy.spatial import distance as dist
from imutils.video import VideoStream
from imutils import face_utils
from threading import Thread
from threading import Timer
from ch... |
actor_factory.py | #!/usr/bin/env python
#
# Copyright (c) 2020 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
#
import time
from threading import Thread, Lock
import itertools
from enum import Enum
try:
import queue
except ImportError:
im... |
multi_download.py | #!/usr/bin/env python3
# -*-coding:utf-8-*-
import sys
import threading
import os
import argparse
import serial.tools.list_ports
ESP_TOOL = "components/esptool_py/esptool/esptool.py"
class MultiDownloader():
""" Multi downloader for esp32 """
CMAKE_BUILD_SUCESS_STRING = "Project build complete. To flash, run... |
HTOLSserver.py | import socket
import time
import sys
import os
import multiprocessing
import xml.etree.ElementTree
def handleConn(conn, addr):
conn.send(b'What is your name?')
teamName = conn.recv(1024).decode("utf-8")
conn.send(b'What is your quest?')
imageName = conn.recv(1024).decode("utf-8")
conn.send(b'What is your favor... |
smtio.py | #
# yosys -- Yosys Open SYnthesis Suite
#
# Copyright (C) 2012 Claire Xenia Wolf <claire@yosyshq.com>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.... |
helper.py | import asyncio
import functools
import json
import math
import os
import random
import re
import sys
import threading
import time
import uuid
import warnings
from argparse import ArgumentParser, Namespace
from datetime import datetime
from itertools import islice
from types import SimpleNamespace
from typing import (
... |
__init__.py | from threading import Thread
from singleton.singleton_impl import Singleton, Logger
def push_log(value):
inside_logger = Logger(value)
for i in range(10):
inside_logger.info('pass info')
if __name__ == "__main__":
process1 = Thread(target=push_log, args=("FOO",))
process2 = Thread(target=p... |
test_thread_safety.py | #!/usr/bin/env python
import unittest
from threading import Thread
from requests_cache import CachedSession
CACHE_NAME = 'requests_cache_test'
class ThreadSafetyTestCase(unittest.TestCase):
def test_caching_with_threads(self):
def do_tests_for(backend):
s = CachedSession(CACHE_NAME, backend)... |
piHygroThermoDHT.py | #!/usr/bin/python3
# File name : piHygroThermoDHT.py
# Description : encapsulate the DHT sensor (humidity & temperature) in Raspberry Pi
# dependency : Freenove_DHT.py from github
# https://github.com/Freenove/Freenove_Ultimate_Starter_Kit_for_Raspberry_Pi/tree/master/Code/Python_Code/21.1.1_DHT11
im... |
view_serial.py | import glob
import socket
import sys
import threading
import logging
import serial
from PySide2 import QtCore, QtGui, QtWidgets
from Codecs.AdcpCodec import AdcpCodec
from Comm.AdcpSerialPortServer import AdcpSerialPortServer
import configparser
settings = configparser.ConfigParser()
settings._interpolation = config... |
graphicsCrawlerDisplay.py | # graphicsCrawlerDisplay.py
# -------------------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a ... |
main.py | import logging
import multiprocessing
import os
import signal
import sys
import time
from typing import Any
from datastore.reader.app import register_services
from gunicorn.app.base import BaseApplication
from .shared.env import Environment
from .shared.interfaces.logging import LoggingModule
from .shared.interfaces.... |
ws.py | #!/usr/bin/env python3
# coding=utf-8
# requires https://pypi.python.org/pypi/websocket-client/
from excepthook import uncaught_exception, install_thread_excepthook
import sys
sys.excepthook = uncaught_exception
install_thread_excepthook()
# !! Important! Be careful when adding code/imports before this point.
# Our e... |
run_manager.py | # -*- encoding: utf-8 -*-
import errno
import json
import logging
import os
import re
import signal
import socket
import stat
import subprocess
import sys
import time
from tempfile import NamedTemporaryFile
import threading
import yaml
import numbers
import inspect
import glob
import platform
import fnmatch
import cl... |
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 tempfile
impor... |
utils.py | import os
import datetime
from multiprocessing import Process
import time
import yaml
import streamlit as st
import psutil
import pandas as pd
from typing import Callable, Union, Tuple
from alphapept.paths import PROCESSED_PATH
@st.cache(allow_output_mutation=True)
def load_file(file:str) -> dict:
"""Cached stre... |
pythonFile.py | # Copyright (c) 2020 Daniel Pietz
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... |
helper.py | import asyncio
import functools
import inspect
import json
import math
import os
import random
import re
import sys
import threading
import time
import uuid
import warnings
from argparse import ArgumentParser, Namespace
from collections.abc import MutableMapping
from datetime import datetime
from itertools import islic... |
server_part2.py |
from socket import *
import sys
from threading import Thread, activeCount
def request(connectionSocket,clientInfo):
print("client {} has connected".format(clientInfo))
try:
message = connectionSocket.recv(1024).decode() #recieve message from the client
filename = message.split()... |
ib_contract_asynch_event.py | # -*- coding: utf-8 -*-
"""
IBAPI - Getting Contract info
@author: Mayank Rasu (http://rasuquant.com/wp/)
"""
from ibapi.client import EClient
from ibapi.wrapper import EWrapper
from ibapi.contract import Contract
import threading
import time
class TradingApp(EWrapper, EClient):
def __init__(self):
ECli... |
test_streamming.py | # Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
from . import SmokeTest
import time
import threading
import carla
class TestStreamming(SmokeTest)... |
osa_utils.py | #!/usr/bin/python3
"""
(C) Copyright 2020-2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
import ctypes
import queue
import time
import threading
import re
from avocado import fail_on
from ior_test_base import IorTestBase
from mdtest_test_base import MdtestBase
from command_utils import C... |
test_run.py | import contextvars
import functools
import platform
import sys
import threading
import time
import types
import warnings
from contextlib import contextmanager, ExitStack
from math import inf
import attr
import outcome
import sniffio
import pytest
from async_generator import async_generator
from .tutil import slow, ch... |
get_tweet.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import copy
import json
import requests
from requests_oauthlib import OAuth1
import signal
import threading
import yaml
from db_setup import db_connection
from db_setup import db_connect
from db_setup import db_insert_to_tweet
from db_setup import db_select_from_dict
# ... |
email.py | from flask_mail import Message
from flask import render_template
from app import mail, app
from threading import Thread
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(subject, sender=sender, recipi... |
attach_temp.py | import xml.etree.ElementTree as ET
import csv
import pandas as pd
import multiprocessing
# d = {}
# for i in range(1, 86):
# d[i] = pd.DataFrame(columns=['structure_id', 'chain_id', 'ec_no', 'source', 'classification', 'sequence', 'chain_length'])
# mapping = dict()
# mapping['dimEntity.structureId'] = 'structur... |
test_language_server.py | # Copyright 2017 Palantir Technologies, Inc.
import os
from threading import Thread
from jsonrpc.exceptions import JsonRpcMethodNotFound
import pytest
from pyls.python_ls import start_io_lang_server, PythonLanguageServer
CALL_TIMEOUT = 2
def start_client(client):
client.start()
@pytest.fixture
def client_ser... |
test_utils.py | import html
import pickle
import threading
import time
import pytest
import boardgamegeek.utils as bggutil
from _common import *
from boardgamegeek.objects.things import Thing
def test_get_xml_subelement_attr(xml):
node = bggutil.xml_subelement_attr(None, "hello")
assert node is None
node = bggutil.xml_... |
main.py | #!/usr/bin/env python
# -*- coding: utf8 -*-
from __future__ import unicode_literals
import logging
import os.path
import uuid
import signal
import sys
import threading
import json
import encodings
import time
import serial
import RPi.GPIO as GPIO
import picamera
import multiwii
import server
class Main():
def st... |
train_sampling.py | """Training GCMC model on the MovieLens data set by mini-batch sampling.
The script loads the full graph in CPU and samples subgraphs for computing
gradients on the training device. The script also supports multi-GPU for
further acceleration.
"""
import os, time
import argparse
import logging
import random
import stri... |
test_dota_r3det_efficientnet_ms.py | # -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import sys
import tensorflow as tf
import cv2
import numpy as np
import math
from tqdm import tqdm
import argparse
from multiprocessing import Queue, Process
sys.path.append(".... |
gcbench.py | # Ported from a Java benchmark whose history is :
# This is adapted from a benchmark written by John Ellis and Pete Kovac
# of Post Communications.
# It was modified by Hans Boehm of Silicon Graphics.
#
# This is no substitute for real applications. No actual application
# is likely to behave in exactl... |
tf_util.py | import joblib
import numpy as np
import tensorflow as tf # pylint: ignore-module
import copy
import os
import functools
import collections
import multiprocessing
def switch(condition, then_expression, else_expression):
"""Switches between two operations depending on a scalar value (int or bool).
Note that bot... |
test_subprocess.py | import unittest
from test import script_helper
from test import support
import subprocess
import sys
import signal
import io
import locale
import os
import errno
import tempfile
import time
import re
import sysconfig
import warnings
import select
import shutil
import gc
import textwrap
try:
import resource
except ... |
label_sync.py | # ElectrumSV - lightweight Bitcoin client
# Copyright (C) 2014 Thomas Voegtlin
# 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... |
dask.py | # pylint: disable=too-many-arguments, too-many-locals, no-name-in-module
# pylint: disable=missing-class-docstring, invalid-name
# pylint: disable=too-many-lines, fixme
# pylint: disable=too-few-public-methods
# pylint: disable=import-error
"""Dask extensions for distributed training. See
https://xgboost.readthedocs.io... |
handlers_oneway.py | # -*- coding: utf-8 -*-
import logging
import threading
from copy import copy
import pika
from pika import credentials
from .compat import Queue
from .filters import FieldFilter
from .formatters import JSONFormatter
from .compat import ExceptionReporter
class RabbitMQHandlerOneWay(logging.Handler):
"""
Pyth... |
keep_alive.py | # ██▀███ ▓█████▄▄▄█████▓ ██▀███ ▒█████
# ▓██ ▒ ██▒▓█ ▀▓ ██▒ ▓▒▓██ ▒ ██▒▒██▒ ██▒
# ▓██ ░▄█ ▒▒███ ▒ ▓██░ ▒░▓██ ░▄█ ▒▒██░ ██▒
# ▒██▀▀█▄ ▒▓█ ▄░ ▓██▓ ░ ▒██▀▀█▄ ▒██ ██░
# ░██▓ ▒██▒░▒████▒ ▒██▒ ░ ░██▓ ▒██▒░ ████▓▒░
# ░ ▒▓ ░▒▓░░░ ▒░ ░ ▒ ░░ ░ ▒▓ ░▒▓░░ ▒░▒░▒░
# ░▒ ░ ▒░ ░ ░ ░ ░ ░▒ ░ ▒░ ░ ▒ ▒░
# ░░ ... |
server.py | import threading
import socket
import time
import mongo_dao
import rsa
import pickle
import logging
import Security
logging.basicConfig(filename='app_log.txt', level=logging.DEBUG,
format=f'%(levelname)s %(asctime)s %(name)s %(threadName)s : %(message)s')
def log(typ: str, text: str):
'''
... |
surface_stats_collector.py | # Copyright 2013 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.
try:
import Queue
except ImportError:
import queue as Queue
import datetime
import logging
import re
import threading
# Log marker containing SurfaceTe... |
test_crt_temp_image_progress.py | '''
Test Progress of Create Image Template from Root Volume
@author: quarkonics
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.zstack_test.zstack_test_image as test_image
import zstackwo... |
lightwave.py | """Python library to provide reliable communication link with LightWaveRF lights and switches."""
import logging
import socket
import time
from itertools import cycle
from queue import Queue
from threading import Thread
_LOGGER = logging.getLogger(__name__)
class LWLink():
"""LWLink provides a communication link... |
ProduceConsume.py | import threading
import random
import time
fruits = []
def produce():
global fruits
while True:
fruit = random.randint(0, 100)
fruits.append(fruit)
print("I created the fruit #{0}".format(fruit))
time.sleep(0.1)
def consume():
global fruits
while True:
if len(fruits) > 0:
fruit = fruits.pop(0)
pri... |
SSHTestParamikoPortForward.py | import paramiko
from paramiko import RSAKey
import threading
import socket
import select
def handleTcpSocket(chan, host, port):
sock = socket.socket()
try:
sock.connect((host, port))
except Exception, e:
print('Forwarding request to %s:%d failed: %r' % (host, port, e))
return
#print('Connected! Tunnel... |
oes_td.py | import time
from copy import copy
from dataclasses import dataclass
from datetime import datetime, timedelta, timezone
from gettext import gettext as _
from threading import Lock, Thread
# noinspection PyUnresolvedReferences
from typing import Any, Callable, Dict
from vnpy.api.oes.vnoes import OesApiClientEnvT, OesApi... |
storj_synchronization_background_server.py | # !/usr/bin/env python
"""
HTTP C&C server for synchronization management for Storj GUI
"""
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from synchronization_core import SyncObserverWorker
import threading
SYNC_SERVER_PORT = 8234
sync_observer_worker = SyncObserverWorker()
class StorjSyncServerHandl... |
reader.py | # Copyright (C) 2021 G. H. Collin (ghcollin)
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE.txt file for details.
import struct
import multiprocessing
import threading
from contextlib import contextmanager
import numpy as np
import sys
_PYTHON3 = sys.version_i... |
monitor.py | import asyncio
import inspect
import logging
import os
import signal
import socket
import sys
import threading
import traceback
from textwrap import wrap
from types import TracebackType
from typing import (IO, Dict, Any, Callable, Optional, Tuple, Generator, # noqa
List, Type, TypeVar, NamedTuple, ... |
common.py | """Test the helper method for writing tests."""
import asyncio
import collections
from collections import OrderedDict
from contextlib import contextmanager
from datetime import timedelta
import functools as ft
from io import StringIO
import json
import logging
import os
import sys
import threading
import time
import uu... |
client.py | import threading
import zmq
import time
import abc
import sys
import os
from dasc.utils.messages import from_msg, to_msg
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../')))
import logging
log = logging.getLogger(__name__)
class SerializingSocket(zmq.Socket):
"""A class with some ... |
mail.py | #!/usr/bin/python3
"""
"""
import smtplib, threading, time
from datetime import datetime, timedelta
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
class Mail:
def __init__(self, config, database):
self.config = config
self.db = database
self.mail_confi... |
streaming_problem.py | ##
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
##
import logging
import uuid
import io
import gzip
import json
import threading
import sys
from typing import List, Tuple, Union, Dict, Optional, Type
from azure.quantum import Workspace
from azure.quantum.optimization i... |
__init__.py | """
Base classes for job runner plugins.
"""
import os
import time
import string
import logging
import datetime
import threading
import subprocess
from Queue import Queue, Empty
import galaxy.jobs
from galaxy.jobs.command_factory import build_command
from galaxy import model
from galaxy.util import DATABASE_MAX_STRI... |
compress.py | import argparse
import importlib.util
import os.path
import functools
from copy import deepcopy
import configparser
import optuna
from compress_conf.combine import *
from threading import Thread
from train.instantiate import *
from train.train import train
from random import random
import numpy as np
import torch.nn as... |
socket_server.py | from socketserver import BaseRequestHandler, TCPServer
from threading import Thread
class RequestHandler(BaseRequestHandler):
"""
The RequestHandler class for job stopping.
"""
def handle(self):
self.data = self.request.recv(1024).strip()
# just send back the same data, but upper-case... |
main_12_LSTM.py | import Redes.Red_LSTM as Interface
import Auxiliary.preprocessingData as Data
import Auxiliary.GPUtil as GPU
import numpy as np
import os
from threading import Thread
import pickle
import tensorflow as tf
###################################
os.environ["CUDA_VISIBLE_DEVICES"] = "0, 1, 2, 3" # To force tensorflow to... |
pwm_actuator.py | import threading
import time
import RPi.GPIO as io
class PWMActuator(object):
"""
Methods
-------
set(value)
Use software PWM to output a value between 0 and 1
Attributes
----------
pin_number : int (readonly)
value : float (0.0 - 1.0) (readonly)
period : float
"""
... |
conftest.py | import logging
import random
import secrets
import threading
import time
from abc import ABC, abstractmethod
from dataclasses import dataclass
from datetime import datetime, timezone
from typing import Generator, Optional, Dict, Any
import pytest
import requests
from fastapi import FastAPI, Depends, HTTPException
from... |
data_utils.py | # Lint as python3
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... |
startercode.py | import os
import threading
def func():
os.chdir("plotly/")
os.system("python app.py")
def funx():
os.system("gunicorn api:app")
if __name__ == "__main__":
os.system("sudo service mongod start")
t1 = threading.Thread(target=funx)
t2 = threading.Thread(target=func)
t1.start()
t2.star... |
data_utils.py | # -*- coding: utf-8 -*-
"""
Miscellanous functions manage data in image recognition.
network.
Author: Ignacio Heredia
Date: September 2016
"""
import os
import sys
import numpy as np
from PIL import Image, ImageEnhance
import requests
from io import BytesIO
import threading
import Queue
def data_splits(im_dir='/med... |
sideinputs.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
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... |
main.py | #!python3
import sys, threading
import traceback
from PyQt5.QtWidgets import (QApplication, QMainWindow, QDesktopWidget,
QPushButton, QTextEdit)
from PyQt5.QtCore import pyqtSignal, QObject, Qt
from models.TranslateClient import TranslateClient
PORT = 1080
RETRY = 3
class Clipboard(object):
... |
_Command.py | #-----------------------------------------------------------------------------
# Title : PyRogue base module - Command Class
#-----------------------------------------------------------------------------
# This file is part of the rogue software platform. It is subject to
# the license terms in the LICENSE.txt fil... |
ThreadPrototype.py | import sys
import threading
import subprocess
from utils.RaasLogger import RaasLogger
class ThreadPrototype(threading.Thread):
def __init__(self):
super(ThreadPrototype, self).__init__()
self.thread = threading.Thread(target=self.run, args=())
self.thread.deamon = True
self.killed... |
gstreamer.py | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
exercise5.py | import random
import threading
import time
import math
import copy
from emulators.Device import Device
from emulators.Medium import Medium
from emulators.MessageStub import MessageStub
class MulticastMessage(MessageStub):
def __init__(self, sender: int, destination: int, content):
super().__init__(sender... |
test_client_http.py | import select
import socket
import contextlib
import threading
from tests import mock
from tests import unittest
from contextlib import contextmanager
import botocore.session
from botocore.config import Config
from botocore.vendored.six.moves import BaseHTTPServer, socketserver
from botocore.exceptions import (
Co... |
macdivert.py | # encoding: utf8
import os
import Queue
import threading
import libdivert as nids
from copy import deepcopy
from ctypes import cdll
from enum import Defaults, Flags
from ctypes import POINTER, pointer, cast
from ctypes import (c_void_p, c_uint32, c_char_p, c_int, CFUNCTYPE,
create_string_buffer, c_... |
tasks.py | import logging
import threading
from celery import shared_task
from celery.task import periodic_task
from common.utils import get_object_or_none
from ansible_api.ctx import change_to_root
from kubeops_api.models.cluster import Cluster
from kubeops_api.models.deploy import DeployExecution
import kubeops_api.cluster_ba... |
task_config_monitor.py | """
Copyright (c) 2015 SONATA-NFV
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 agreed to... |
test.py | #!/usr/bin/env python3
#
# unit tests for debugger
import os
import re
import sys
import time
import platform
import threading
import traceback
import subprocess
from struct import unpack
import colorama
sys.path.append('..')
import debugger.lldb as lldb
import debugger.dbgeng as dbgeng
import debugger.DebugAdapter... |
job_service.py | import logging
import os
import signal
import threading
import time
import traceback
from concurrent.futures import ThreadPoolExecutor
from typing import Dict, List, Tuple, cast
import grpc
from google.api_core.exceptions import FailedPrecondition
from google.protobuf.timestamp_pb2 import Timestamp
import feast
from ... |
test_socket.py | import time
import unittest
import six
if six.PY3:
from unittest import mock
else:
import mock
from engineio import exceptions
from engineio import packet
from engineio import payload
from engineio import socket
class TestSocket(unittest.TestCase):
def setUp(self):
self.bg_tasks = []
def _g... |
minio_utils.py | import atexit
import logging
import multiprocessing
import subprocess
import time
from urlparse import urlparse
import minio
from django.conf import settings
from minio import policy
from minio.error import BucketAlreadyOwnedByYou, ResponseError
logger = logging.getLogger(__name__)
def start_minio():
"""
St... |
__init__.py | # -*- coding: utf-8 -*-
# vim: set expandtab shiftwidth=4:
__import__('gevent.monkey').monkey.patch_all()
import time
import logging
import threading
from tornado.ioloop import IOLoop
from tornado.tcpserver import TCPServer
from tornado import gen
from libs.daemon.simpledaemon import SimpleDaemon
from libs.server.t... |
client.py | import numpy as np
import os, time
import cv2, dlib
from filterpy.kalman import KalmanFilter
from assign import *
import requests
from multiprocessing import Queue, Process
from threading import Thread, Timer
class Track():
""" Track Object that keep track of each object."""
def __init__(self, ID, bbox, ground... |
server.py | from common.protocol import Protocol
from typing import Optional
import socket
import threading
import time
class Server:
def __init__(self, name:str, host: str, port: Optional[int] = 22) -> None:
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.name = name
se... |
cadabot.py | import datetime
import os
import random
import threading
import time
from functools import partial
import inflect
import praw
import schedule
from dotenv import load_dotenv
from loguru import logger
from nltk.sentiment.vader import SentimentIntensityAnalyzer
from sqlitedict import SqliteDict
load_doten... |
agent.py | from __future__ import print_function
from builtins import zip
from builtins import range
from builtins import object
# Copyright 2018 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ... |
hostutils.py | import multiprocessing
import multiprocessing.synchronize
import os
import platform
import psutil # type: ignore
import queue
import subprocess
import sys
import threading
import time
from enum import Enum
from typing import Any, Optional, Sequence, Tuple, Union, overload
from arcadeutils import FileBytes, BinaryDiff... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.