source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
train.py | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
interactive_regression.py | ##
## Camera
##
from jetcam.csi_camera import CSICamera
# from jetcam.usb_camera import USBCamera
camera = CSICamera(width=224, height=224)
# camera = USBCamera(width=224, height=224)
camera.running = True
##
## Task
##
import torchvision.transforms as transforms
from xy_dataset import XYDataset
TASK = 'road_follow... |
olibox_core.py |
import atexit
import threading
import time
import toml
import olibox_core.olibox_core.core_modules as mod
import olibox_core.olibox_core.olibox_pkg as pkg
# load user input
print('Welcome to OLIBOX Core v0.1!')
print('Authors: Muhammad Yahya & Felix Förster @ OLI Systems 2020')
print('Contact: github.com/olisystem... |
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
----------------------------------... |
execute.py | import subprocess
from shadowray.config.v2ray import EXECUTE_ARGS, V2RAY_PID_FILE, CONFIG_STREAM_FILE
from shadowray.common.utils import write_to_file
import multiprocessing
import time
import os, sys
class Execute:
def __init__(self, binary):
self.v2ray_binary = binary
self.config = None
def... |
RealtimeBase2_v2.py | from multiprocessing import Process
from multiprocessing import Manager
from contextlib import suppress
import json
import gevent.monkey
import requests
import time
from steem.steemd import Steemd
def read_block(start_block_num, last_block_num):
# 블록 가져오는 부분
blocks = []
threads = []
print(... |
translate_new.py | from selenium import webdriver
import threading
from queue import Queue
from tqdm import tqdm
import warnings
import time
import urllib.parse
warnings.filterwarnings('ignore')
# er8xn
span = '/html/body/c-wiz/div/div[2]/c-wiz/div[2]/c-wiz/div[1]/div[2]/div[2]/c-wiz[2]/div[5]/div/div[1]/span[1]/span/span'
class Tran... |
line_detector_node.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)
from duckietown_utils.instantiate_utils import instantiate
from duckietown_utils.jpg import image_cv_fr... |
distribute_worker.py | from .worker import Worker
# from worker import Worker
# from test_x import Worker
from threading import Thread
from queue import Queue
import time
import json
# qq2 = Queue()
class DistributeWorker(object):
def __init__(self):
self.queue = Queue()
def query(self, phone):
w = Worker()
... |
environment.py | # import threading
# from wsgiref import simple_server
# # from selenium import webdriver
# # from my_application import model
# # from my_application import web_app
# def before_all(context):
# # context.server = simple_server.WSGIServer(('', 8000))
# # context.server.set_app(web_app.main(environment='test'))... |
cache_server.py | import socket
import threading
import pickle
import time
import os
from distcache import config as conf
from distcache.lru_cache import LRUCache
from distcache import utils
from distcache import logger
"""
The server is always listening to the client. It needs to detect if the client is alive.
"""
class CacheServer... |
test_engine.py | # Copyright (c) 2013 Vindeka, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
rdd.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
apiproxy_stub_map_test.py | #!/usr/bin/env python
#
# Copyright 2007 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
AnimThreading.py | import threading
import time
import random
import datetime
from raspledstrip.color import *
# This is for the initial thread as well as when the light has been set to something that does not require a thread
def DoNothing(killEvent):
# Block till event is set
killEvent.wait()
class BaseAnimationClass(obj... |
test_sys.py | from test import support
from test.support.script_helper import assert_python_ok, assert_python_failure
import builtins
import codecs
import gc
import locale
import operator
import os
import struct
import subprocess
import sys
import sysconfig
import test.support
import textwrap
import unittest
import warnings
# coun... |
1.Thread.Create.py | # -*- coding: utf-8 -*-
"""
在Python中我们主要是通过thread和threading这两个模块来实现的,
其中Python的threading模块是对thread做了一些包装的,可以更加方便的被使用,所以我们使用threading模块实现多线程编程。
一般来说,使用线程有两种模式,一种是创建线程要执行的函数,把这个函数传递进Thread对象里,让它来执行;
另一种是直接从Thread继承,创建一个新的class,把线程执行的代码放到这个新的 class里。
"""
# 1. 将函数传递进Thread对象:
import threading
def thread_fu... |
GFWeather.py | """
每天定时给多个女友发给微信暖心话
核心代码。
"""
import os
import time
from datetime import datetime
import itchat
from itchat.content import TEXT
import requests
import yaml
from apscheduler.schedulers.blocking import BlockingScheduler
from bs4 import BeautifulSoup
from simplejson import JSONDecodeError
import threading
import city_di... |
load_genome.py | import argparse
import gzip
import Bio.SeqIO as bpio
from Bio.SeqRecord import SeqRecord
from Bio.Seq import Seq
from tqdm import tqdm
import sys
parser = argparse.ArgumentParser()
parser.add_argument('-g', help='foo help',required=True)
args = parser.parse_args()
from BioSQL import BioSeqDatabase
server = BioSeq... |
onenote_auth.py | import datetime
import json
import logging
import webbrowser
from contextlib import suppress
from http.server import BaseHTTPRequestHandler, HTTPServer
from pathlib import Path
from queue import Queue
from threading import Thread
from time import sleep
from urllib.parse import urlparse
from oauthlib.oauth2... |
mlab_test.py | # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
solution2.py | #!/usr/bin/env python
"""
Solution to day 13 part 2
Robot painting time
"""
from collections import defaultdict
import curses
import inspect
import logging
import threading
from typing import List, Callable
from queue import SimpleQueue
from defaultlist import defaultlist
OpCodes = List[int]
logging.basicConfig(
... |
wpforce.py | import sys
import time
import socket
import urllib2
import argparse
import threading
__author__ = 'n00py'
# These variables must be shared by all threads dynamically
correct_pairs = {}
total = 0
def has_colours(stream):
if not hasattr(stream, "isatty"):
return False
if not stream.isatty():
retu... |
async_executor.py | import logging
from threading import RLock, Thread
logger = logging.getLogger(__name__)
class AsyncExecutor(object):
def __init__(self):
self._thread_lock = RLock()
self._scheduled_action = None
self._scheduled_action_lock = RLock()
@property
def busy(self):
return self.... |
trackwriter.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ts=2 sw=2 et ai
###############################################################################
# Copyright (c) 2012,2013 Andreas Vogel andreas@wellenvogel.net
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and a... |
ios_device.py | # Copyright 2019 WebPageTest LLC.
# Copyright 2017 Google Inc.
# Use of this source code is governed by the Apache 2.0 license that can be
# found in the LICENSE file.
"""Interface for iWptBrowser on iOS devices"""
import base64
import logging
import multiprocessing
import os
import platform
import select
import shutil... |
tool.py | import argparse
import math
import os
import pickle
import re
import sys
from multiprocessing import Process
import pandas as pd
import psutil
import hypergbm
from hypergbm.cfg import HyperGBMCfg as cfg
from hypernets.tabular import get_tool_box as get_tool_box_, is_dask_installed, is_cuml_installed
from hypernets.ut... |
worlds.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from parlai.mturk.core.worlds import MTurkOnboardWorld, MTurkTaskWorld
import threading
import random
import copy
import ... |
store.py | from flask import (
flash
)
import json
import logging
import os
import threading
import time
import uuid as uuid_builder
from copy import deepcopy
from os import mkdir, path, unlink
from threading import Lock
import re
import requests
import secrets
from . model import App, Watch
# Is there an existing library t... |
webcamvideostream.py | # import the necessary packages
from threading import Thread
import cv2
class WebcamVideoStream:
def __init__(self, src=0, name="WebcamVideoStream"):
# initialize the video camera stream and read the first frame
# from the stream
cap = cv2.VideoCapture(src)
cap.set(cv2.CAP_PROP_FOURCC,cv2.VideoW... |
dig_refine.py | from sage.all import operator
from vu_common import (VLog, pause, is_list, is_empty, vset)
from dig_inv import Inv, InvExp, InvEqt, InvMPP, InvIeq
logger = VLog('refine')
logger.level = VLog.INFO
class Refine(object):
"""
Refine result invariants using several techniques, including
1) filtering
2) in... |
main.py | import RPi.GPIO as GPIO
import time
from open import open_door
# from ultrasonic import distance
import camera_servo
import nfc
import threading
import btn
import subprocess
def check_camera():
camera_flag = str(subprocess.Popen(['ps -a | grep mjpg'], stdout=subprocess.PIPE, shell=True).communicate()[0],
... |
pyqt_inter_audio.py | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 3 21:33:24 2020
@author: Ampofo
"""
import os
import threading
from PyQt5.QtCore import pyqtProperty, QObject, pyqtSlot
from .audio import Audio
class QAudio(QObject):
"""
"""
def __init__(self, parent=None):
super().__init__(parent)
se... |
combat_standalone.py | # The intent of this test is to verify that a standalone combat bot works
# And then incorporate the working standalone back into the v3 test bot
from hsvfilter import grab_object_preset
from windowcapture import WindowCapture
from vision import Vision
import os
import combo
import threading
import time
import pydirect... |
slack.py | from slackclient import SlackClient
from chatterbot import ChatBot
import sys
sys.path.append("../..")
from server.communication.tasks.test_task import TestTask
from server.communication.tasks.help_task import HelpTask
from server.communication.tasks.show_last_image import ShowTask
import time
import threading
import j... |
main.py | import threading
import time
def timer():
count = 0
while True:
time.sleep(1)
count += 1
print("Program aktywny. ", count)
x = threading.Thread(target=timer, daemon=True)
x.start()
print(x)
input("Chcesz wyjsc?\n")
|
publisher.py | # -*- coding: utf-8 -*-
'''
Listener worker process
'''
from __future__ import absolute_import
# Import pythond stdlib
import os
import signal
import logging
import threading
# Import third party libs
import zmq
import umsgpack
import nacl.utils
import nacl.secret
# Import napalm-logs pkgs
from napalm_logs.config im... |
main.py | import datetime
import os
import sys
import re
import threading
import math
from PyQt5.QtWidgets import *
from PyQt5.uic import *
from sqlalchemy import *
ui, _ = loadUiType(os.path.join(os.path.dirname(__file__), '../ui/app.ui'))
class Main(QMainWindow, ui):
# the initialization for the app
def __init__(se... |
xcmtest.py | #!/usr/bin/python3
import unittest
import xcm
import echod
import multiprocessing
import time
import random
import os
import config
import errno
import gc
def run_server(addr):
echod.run(addr)
def echo_server(addr):
p = multiprocessing.Process(target=run_server, args=(addr,))
p.start()
return p
TEST... |
example4.py | #!/usr/bin/env python
import threading
def worker(n):
print('new worker: %d' % (n))
for i in range(8):
threading.Thread(target = worker, args = (i,)).start()
|
tpu_estimator.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... |
backloop.py | import asyncio
import threading
class BackgroundLoop(object):
"""
Wrapping an asyncio.eventloop in order to execute it in the background.
This makes running async code easy to manage, and make computation actually more visible, inside a context manager
TODO : doctest usage sample
"""
def __... |
tor_manager.py | """
owtf.http.proxy.tor_manager
~~~~~~~~~~~~~~~~~~~~~~~~~~~
TOR manager module developed by Marios Kourtesis <name.surname@gmail.com>
"""
import commands
import socket
import time
from multiprocessing import Process
from owtf.dependency_management.dependency_resolver import BaseComponent
from owtf.lib.general import... |
session.py | import os
import atexit
import signal
import threading
from typing import Optional
from aim.sdk.legacy.session.utils import exception_resistant
from aim.sdk.legacy.deprecation_warning import deprecated
from aim.ext.resource.configs import DEFAULT_SYSTEM_TRACKING_INT
from aim.ext.resource.tracker import ResourceTracker... |
engine.py | import copy
import json
import os
import platform
import queue
import shlex
import subprocess
import sys
import threading
import time
import traceback
from typing import Callable, Dict, List, Optional
from kivy.utils import platform as kivy_platform
from katrain.core.constants import OUTPUT_DEBUG, OUTPUT_ERROR, OUTPU... |
onnxruntime_test_python.py | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# -*- coding: UTF-8 -*-
import unittest
import os
import numpy as np
import onnxruntime as onnxrt
import threading
from helper import get_name
class TestInferenceSession(unittest.TestCase):
def run_model(self, session_... |
ImageNodeTest.py | ##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Redistrib... |
log.py | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import contextlib
import copy
import io
import logging
import logging.handlers
import re
import subprocess
import sys
import threading
impo... |
PyChip8.py | import pygame, sys, os
from pygame.locals import *
#import thread
import threading
from System import *
# References
_Sys = None
_CRT = None
# ------------------------------------------------------------
# Main Routine
# ------------------------------------------------------------
# Constructor
py... |
qaoa_process.py | import multiprocessing as mp
import queue
from copy import deepcopy
class QAOAProcess(mp.Process):
def __init__(self,job,qctrl,qresult,quantities,nlayers,C,D=None,psi0=None):
from qaoa.circuit import QAOACircuit
super().__init__()
self.qctrl = qctrl
self.qresult = qresult
s... |
reloader.py | import subprocess
import sys
import signal
import os
import threading
import time
def sig_winch(*args):
sys.exit(111)
def start_new_process():
while 1:
argv = sys.argv
env = os.environ.copy()
env['BORING_RELOAD_PROC'] = 'true'
try:
code = subprocess.call(argv, env=... |
forch_metrics.py | """Module to expose varz interface"""
import functools
import threading
from prometheus_client import Counter, Gauge, Info, generate_latest, REGISTRY
from forch.http_server import HttpServer
from forch.utils import get_logger
LOGGER = get_logger('metrics')
DEFAULT_VARZ_PORT = 8302
class ForchMetrics():
"""Clas... |
qira_program.py | from __future__ import print_function
from qira_base import *
import qira_config
import qira_analysis
import os
import shutil
import resource
import sys
import subprocess
import threading
import time
import collections
from hashlib import sha1
from subprocess import (Popen, PIPE)
import json
import struct
import qir... |
models.py | from django.db import models
import scrapy
from scrapy.crawler import CrawlerProcess
import scrapy
import scrapy.crawler as crawler
from multiprocessing import Process, Queue
from twisted.internet import reactor
from scrapy.utils.log import configure_logging
import json
class IoeSpider(scrapy.Spider):
name = "i... |
streamed_process.py | import subprocess
import select
import sys
import signal
from threading import Thread
from time import sleep
import time
from log_stream import *
import atexit
import os
class TimeoutError(Exception): pass
class timeout:
def __init__(self, seconds=1, error_message='Timeout'):
self.seconds = seconds
... |
base.py | # Copyright (C) 2016 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
jsl_monitor.py | # 使用jsl作为数据源
import requests
import sys
sys.path.append('..')
import time
import threading
from configure.settings import config
from common.BaseService import BaseService, HistorySet
from configure.util import get_holding_list
from datahub.jsl_login import login
ACCESS_INTERVAL = config['jsl_monitor']['ACCESS_INTER... |
fog_nodes_manager.py | from multiprocessing import cpu_count, Process
from dctp import ServerDCTP, ClientDCTP
from fog_node import FogNode
from utils import LoadJsonFile
from wallet import Wallet
class WorkerProcess(Process):
def __init__(self, process_name, port):
super().__init__()
self.process_name = process_name
... |
test_mturk_manager.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import os
import time
import json
import threading
import pickle
from unittest import mock
from parlai.m... |
thread.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 ... |
httpexpect.py | # Copyright (c) 2019 Vitaliy Zakaznikov
#
# 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 i... |
QATdx_adv.py | # coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2019 yutiansut/QUANTAXIS
#
# 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 th... |
serverutils.py | import os
import sys
import socket
import Queue
import logging
import logging.handlers
import ConfigParser
from threading import Thread
from pydispatch import dispatcher
from tyr import resources
from tyr import events
from tyr import testutils
log = logging.getLogger('server-utils')
log.setLevel(logging.DEBUG)
log.a... |
lmps.py | # ******************************************************************************
# pysimm.lmps module
# ******************************************************************************
#
# ******************************************************************************
# License
# ******************************************... |
day26-8 主进程会等待所有的子进程执行完成以后再退出.py | import multiprocessing
import time
# 主进程会等待子进程执行完毕后再退出
# 如果子进程是个死循环呢?
# 解决办法:主进程退出子进程销毁
# 1.让子进程设置为守护主进程,主进程退出,子进程销毁,子进程依赖与主进程。
# 2.在主进程退出前
def task():
for i in range(10):
print("任务执行中。。。")
time.sleep(0.2)
# 判断是否是直接执行的模块,程序入口模块
# 标准python写法,直接执行的模块,需要加上判断是否是主模块的代码
if __name__ == '__main__':
... |
py_utils.py | # Lint as: python2, python3
# -*- coding: utf-8 -*-
# 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... |
integration_test.py | import configparser
import os.path
import queue
import sys
import threading
import time
import traceback
import zipfile
import yaml
from collections import OrderedDict
from eu.softfire.integrationtest.main.experiment_manager_client import create_user, upload_experiment, \
delete_experiment, deploy_experiment, get_... |
gloo_example.py | #!/usr/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... |
process.py | # -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, with_statement
import copy
import os
import sys
import time
import errno
import types
import signal
import logging
import threading
import contextlib
import subprocess
import multiprocessing
import multiprocessing.util
# Import salt... |
test_io.py | """Unit tests for the io module."""
# Tests of io are scattered over the test suite:
# * test_bufio - tests file buffering
# * test_memoryio - tests BytesIO and StringIO
# * test_fileio - tests FileIO
# * test_file - tests the file interface
# * test_io - tests everything else in the io module
# * test_univnewlines - ... |
client.py | from encryption.X3DH import ExtendedTripleDiffieHellman
from encryption.XEdDSA import XEdDSA
from encryption.ECC import MontgomeryCurve25519, TwistedEdwardCurve25519
from util.protocol import Protocol
from util.cutom_typing import *
from Crypto.Cipher import AES
from threading import Thread
from socket import AF_INET... |
test_schedulers.py | from logging import StreamHandler, getLogger, INFO
from datetime import datetime, timedelta
from threading import Thread
from pytz import utc
import pytest
import six
from apscheduler.executors.base import BaseExecutor, MaxInstancesReachedError
from apscheduler.executors.debug import DebugExecutor
from apscheduler.jo... |
data.py | """
Data model class file.
author: Matthew Casey
© [Digital Content Analysis Technology Ltd](https://www.d-cat.co.uk)
"""
import i18n
from marshmallow import Schema, EXCLUDE
import os
from time import sleep
from fusion_platform.common.raise_thread import RaiseThread
from fusion_platform.common.utilities import... |
task_space_control_using_sim_only.py | #! /usr/bin/env python
# /***************************************************************************
#
# @package: panda_siimulator_examples
# @metapackage: panda_simulator
# @author: Saif Sidhik <sxs1412@bham.ac.uk>
#
# **************************************************************************/
# /*************... |
op_test_types.py | # coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2016
from __future__ import unicode_literals
from builtins import *
# Import the SPL decorators
from streamsx.spl import spl
import sys
#------------------------------------------------------------------
# Test passing in SPL types functions
... |
common.py | import argparse
import calendar
import collections
import datetime
import glob
import os
import os.path
import pkgutil
import re
import shutil
import signal
import subprocess
import sys
import threading
import time
import numpy
class AllBuilder:
def __init__(self, module_name, init=None):
if init is None... |
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 urllib2
import... |
run-tests.py | #!/usr/bin/env python
#
# 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 "Li... |
ticker.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import os
import threading
from collections import deque
import requests
from PIL import ImageDraw
from papirus import PapirusComposite # requires python2
class BitcoinTicker:
api = 'https://bitcoinapi.de/widget/current-btc-price/rate.json?culture=de'
logo = ... |
test_insert.py | import copy
import threading
import pytest
from pymilvus import DataType, ParamError, BaseException
from utils import util_pymilvus as ut
from common.constants import default_entity, default_entities, default_binary_entity, default_binary_entities, \
default_fields
from common.common_type import CaseLabel
from uti... |
pr_final.py | # !/usr/bin/env python
# -*- coding: utf-8 -*-
# Programa Principal de Control de Radio con Raspberry Pi
import leds.leds_ctrl as led
import radio.radio_ctrl as radio
import RPi.GPIO as GPIO
import threading
import time
import os
def do_ping_audio(radio):
global end
while 1:
try:
radio.server_connect()
ra... |
__init__.py | # Copyright 2019 Atalaya Tech, 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 writing,... |
handler.py | import serial
from serial.tools.list_ports import comports
from threading import Thread, Lock
import time, pandas as pd, traceback as tb, numpy as np
from pycta2045.cta2045 import UnsupportedCommandException, UnknownCommandException, CTA2045
from queue import Queue, Empty
class TimeoutException(Exception):
'''
... |
monitor.py | from json import dumps, loads
import re
import ssl
import threading
import time
import traceback
from monitor.output.base import ConsoleOutputDevice
from monitor.output.oled import RpiOled
from monitor.util import console_log
import requests
from websocket import WebSocketApp
MESSAGE_SIZE_RE = re.compile("^([0-9]+)\n... |
tests.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... |
tasks.py | """This Module handle all asynchronous tasks on API."""
import docker
import requests
import time
import threading
import json
from config import plugins
from model import Projects, Queue
class tasks():
"""Migration Tasks Manager.
This class checks if there are any projects created and if they have
accoun... |
sfx.py | #!/usr/bin/env python3
# coding: latin-1
from __future__ import print_function, unicode_literals
import os, sys, time, bz2, shutil, threading, tarfile, hashlib, platform, tempfile, traceback
"""
to edit this file, use HxD or "vim -b"
(there is compressed stuff at the end)
run me with any version of python, i will ... |
archforce.py | from os import getcwd
from os.path import isfile
from json import load, dump
from webbrowser import open_new_tab
from threading import Thread
from asyncio import get_event_loop_policy, sleep
from zipfile import ZipFile, BadZipFile
from tarfile import TarFile
from tkinter import Tk, Toplevel, filedialog, Menu, S... |
base.py | import argparse
import base64
import copy
import itertools
import json
import multiprocessing
import os
import re
import sys
import threading
import time
import uuid
from collections import OrderedDict
from contextlib import ExitStack
from typing import (
Optional,
Union,
Tuple,
List,
Set,
Dict,... |
CVE-2018-19471.py | # Exploit Title: GitLab 11.4.7 Authenticated Remote Code Execution (No Interaction Required)
# python CVE-2018-19471.py -rh $remotehost -rp $remoteport -U $username -P $password -lh $localhost -lp $localport -t python&perl&bash&ncat [-p $proxyport]
#!/bin/bash/env python3
import requests
import re
import warning... |
utils.py | """helpers for passlib unittests"""
#=============================================================================
# imports
#=============================================================================
from __future__ import with_statement
# core
from binascii import unhexlify
import contextlib
from functools import ... |
optimization_controller.py | import json
import signal
import sys
import threading
import connexion
import re
import os
import subprocess
import time
import gc
import psutil
from IO.MQTTClient import InvalidMQTTHostException
from IO.redisDB import RedisDB
from config.configUpdater import ConfigUpdater
from optimization.ModelException import I... |
chat_client.py | import threading
import socket
import sys
from signal import signal, SIGINT
import time
received_messages = []
ipaddr = '::1'
port = 20002
def display_received_messages(sock):
while True:
resp = sock.recv(256)
resp = resp.decode('utf-8','ignore')
resp = resp.split('|')
... |
mem.py | "Utility functions for memory management"
from ..imports.torch import *
from ..core import *
from ..script import *
from ..utils.env import *
import pynvml, functools, traceback, threading, time
from collections import namedtuple
import platform
IS_IN_IPYTHON = is_in_ipython()
use_gpu = torch.cuda.is_available()
GP... |
sensor.py | """Sensor to monitor incoming/outgoing phone calls on a Fritz!Box router."""
from datetime import datetime, timedelta
import logging
import queue
from threading import Event as ThreadingEvent, Thread
from time import sleep
from fritzconnection.core.fritzmonitor import FritzMonitor
import voluptuous as vol
from homeas... |
treads.py | import threading
def p(x):
for i in range(10):
print(x)
t1 = threading.Thread(target=p, args=(0,))
t2 = threading.Thread(target=p, args=(1,))
t1.start()
t2.start()
t1.join()
t2.join()
|
loader.py | """
The Salt loader is the core to Salt's plugin system, the loader scans
directories for python loadable code and organizes the code into the
plugin interfaces used by Salt.
"""
import copy
import functools
import importlib
import importlib.machinery # pylint: disable=no-name-in-module,import-error
import importlib.... |
mpmanager.py | import multiprocessing,os,time
def workTask(d,l):
d[1] = '1'
d['2'] = 2
d[0.25] = None
l.reverse()
def managerDemo():
with multiprocessing.Manager() as manager:
d = manager.dict()
l = manager.list(range(10))
p = multiprocessing.Process(target=workTask, args=(d,l))
... |
webtransport_h3_server.py | import asyncio
import logging
import os
import ssl
import threading
import traceback
from urllib.parse import urlparse
from typing import Any, Dict, List, Optional, Tuple
# TODO(bashi): Remove import check suppressions once aioquic dependency is resolved.
from aioquic.buffer import Buffer # type: ignore
from aioquic.... |
points_of_interest.py | import pandas as pd
from datetime import datetime, timedelta
import requests
import json
import logging
import os
import matplotlib.pyplot as plt
from numpy import array
from keras.models import Sequential
from keras.layers import LSTM
from keras.layers import Dense
from keras.layers import Bidirectional
from keras.lay... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.