source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
callbacks.py | ###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2014, James McCoy
# 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 copyr... |
trans.py | from threading import Thread
import requests
import base64
from moviepy.editor import *
#url = "https://proxy.api.deepaffects.com/audio/generic/api/v1/async/asr"
#"https://webhook.site/9a465f54-10e2-44a7-b8d6-989c17c9bf50"
#
audio_file_name="mity.wav"
clipA = VideoFileClip("apple.mp4")
clipB = VideoFileClip("apple.m... |
parallel.py | #!/usr/bin/env python
# threading and multiprocessing demo
# Copyright Lesmana Zimmer lesmana@gmx.de
# Licensed under WTFPL version 2
# http://www.wtfpl.net/about/
import sys
import time
import threading
import multiprocessing
import concurrent.futures
import queue
JOBCOUNT = 10
WORKCOUNT = 10_000_000
def main():
... |
dragonBoard.py | import syslog
import time
import serial
import json
import threading
def read_from_port (ser):
while True:
if ser.isOpen():
try:
rawLigne = serial.readline()
if rawLigne != "" and rawLigne[0] == '{' :
tempeData = json.loads(rawLigne)
... |
sqlinstance.py | # -*- coding: utf-8 -*-
# --------------------------------------------------------------------------
# Copyright Commvault Systems, 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
#
# ... |
Arduino_Control_Sistem_1.02_64bit.py | import sys
from PyQt5.QtWidgets import QWidget, QApplication, QLabel, QFileDialog, QSlider, QMenu, QMenuBar, QLCDNumber
from PyQt5.QtWidgets import QPushButton, QLineEdit, QCheckBox, QRadioButton, QButtonGroup, QAction
from PyQt5.QtCore import Qt
from threading import Thread
import serial
import glob
# Разрабо... |
SatadishaModule_final_trie.py |
# coding: utf-8
# In[298]:
import sys
import re
import string
import csv
import random
import time
#import binascii
#import shlex
import numpy as np
import pandas as pd
from itertools import groupby
from operator import itemgetter
from collections import Iterable, OrderedDict
from nltk.tokenize import sent_tokenize... |
port_scanner.py | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import timeit
import netaddr
import multiprocessing
import threading
import Queue
import socket
import sys
import os
import glob
import ast
import argparse
lock = threading.Lock()
scan_result = {}
# merge dictionary1 and dictionary1.
def combineDicts(dictionary1, di... |
Proxy.py | # -*- encoding:utf8 -*-
import requests
import json
import multiprocessing
import random
import traceback
import XX.Date.DatetimeHelper as tsh
import XX.HTTP.RequestsHelper as reqh
import XX.DB.RedisHelper as RH
import redis
import requests
from XX.Tools.Debug import *
# 阿布云大代理
def getProxy(un="H76Z3LKO67NRN5QD", pw... |
supervisor.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
process_queue_test.py | # encoding=utf8
from multiprocessing import Process, Queue
from time import sleep
def get(q):
print("get start...")
while True:
while not q.empty():
info = q.get()
print('get %s' % info)
print('is running')
print('队列已经空了', info)
sleep(1)
def put(q... |
qabondbase.py | #
"""
stock_base
"""
import uuid
import datetime
import json
import os
import threading
import requests
import pandas as pd
import pymongo
from qaenv import (eventmq_ip, eventmq_password, eventmq_port,
eventmq_username, mongo_ip)
import QUANTAXIS as QA
from QUANTAXIS.QAARP import QA_Risk, QA_User
... |
obraz.py | # -*- coding: utf-8 -*-
# Copyright (c) 2012-2018 Andrey Vlasovskikh
#
# 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, ... |
__init__.py | #!/usr/bin/env python
#===============================================================================
# Copyright (c) 2014 Geoscience Australia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
... |
consumer_group.py | '''
An example of consumer groups
'''
import random
from threading import Thread
from multiprocessing import Process
from time import sleep
from util.connection import get_connection
KEY = 'numbers'
GROUP = 'primes'
MEMBERS = 3
def prime(a):
'''
The simplest primality test
Credit: https://rosettacode.org/... |
scheduler.py | # coding=utf-8
"""Module that provides a cron-like task scheduler.
This task scheduler is designed to be used from inside your own program.
You can schedule Python functions to be called at specific intervals or
days. It uses the standard 'sched' module for the actual task scheduling,
but provides much more:
* repea... |
multi_camera_multi_target_tracking_demo.py | #!/usr/bin/env python3
"""
Copyright (c) 2019-2020 Intel 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 applicab... |
ControllerServer.py | # Import modules
from datetime import datetime
import sys
import time
import numpy as np
import pandas as pd
import threading
import datetime
from pyextremes import __version__, get_extremes, EVA
from pyextremes.plotting import plot_extremes
from pyextremes import EVA
from scipy.stats import genextreme
import m... |
server.py | import socket
import threading
HEADER = 64
PORT = 4312
SERVER = socket.gethostbyname(socket.gethostname())
ADDR = (SERVER, PORT)
FORMAT = 'utf-8'
DISCONNECT_MESSAGE = "!DISCONNECT"
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(ADDR)
def handle_client(conn, addr):
print(f"[... |
calibrate.py | # -*- coding: utf-8 -*-
# !/usr/bin/env python
from tkinter import *
import random
import time
from time import gmtime, strftime
import zmq
import json
import queue
import threading
import pandas as pd
import numpy as np
import math
import matlab.engine
class Ball:
def __init__(self, canvas, color):
self... |
recorder.py | # coding: utf-8
import argparse
import pathlib
import cv2
from datetime import datetime
from time import sleep, time
from threading import Thread, Event
from queue import Queue
def main() -> None:
parser = argparse.ArgumentParser(
prog="Video Recorder",
description="Multi input an... |
tests_tensorflow.py | import redis
from functools import wraps
import multiprocessing as mp
from includes import *
'''
python -m RLTest --test tests_tensorflow.py --module path/to/redisai.so
'''
def skip_if_no_TF(f):
@wraps(f)
def wrapper(env, *args, **kwargs):
if not TEST_TF:
env.debugPrint("skipping {} sinc... |
create_clean_snapshots.py | #!/usr/bin/python
from threading import Thread
from functions import *
def create_clean_snapshot(os,instance):
instance.stop()
wait_until_stopped(instance)
volume = get_instance_volume(instance)
create_snapshot(volume,os + "-clean")
threads = []
for os in OSs:
delete_snapshots("Name", os + "-clean... |
dices.py | import os
import telebot
import time
import random
import threading
from emoji import emojize
from telebot import types
from pymongo import MongoClient
import traceback
import json
import requests
import http.cookiejar as cookielib
import urllib
import urllib.request as urllib2
CJ = cookielib.LWPCookieJar()
from reques... |
test_failure.py | import json
import logging
import os
import sys
import tempfile
import threading
import time
import numpy as np
import pytest
import redis
import ray
import ray.ray_constants as ray_constants
from ray.cluster_utils import Cluster
from ray.test_utils import (
relevant_errors,
wait_for_condition,
wait_for_e... |
run_unittests.py | #!/usr/bin/env python3
# Copyright 2016-2017 The Meson development team
# 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 ... |
ShellExec.py | import sys, time, sublime, sublime_plugin, re
from subprocess import Popen, PIPE, STDOUT
from threading import Thread
class ShellExecRun(sublime_plugin.TextCommand):
def run(self, edit, **args):
self.args = args
if ShellExec.get_setting('debug', self.args):
print("\n\n>>>>>>>>>>>>>>>>>> Start Shell Ex... |
GenerateBarcodeWindow.py | """ GenerateBarcodeWindow Class """
import cv2
import tkinter
import tkinter.filedialog
from tkinter.messagebox import showerror, showwarning, showinfo
import copy
import os
import threading
from kalmus.tkinter_windows.meta_info_windows.SpecifyMetaDataWindow import SpecifyMetaDataWindow
from kalmus.tkinter_windows.gu... |
test_browser.py | # coding=utf-8
# Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
import argparse
import json
import multiprocessing
imp... |
instant_mongo.py | import logging
from os import getpid
from pathlib import Path
import re
import subprocess
import threading
from time import monotonic, time, sleep
from .port_guard import PortGuard
from .util import patch_pymongo_periodic_executor, drop_all_dbs
from .util import tcp_conns_accepted_on_port, to_path
logger = logging.g... |
Main.py | import datetime
from modules.TodoList import TodoList
from modules.TodoListChecker import checker
import argparse
import threading
import shlex
def parse_command(command: str):
"""
Parses a command and returns Namespace of the results.
Parameters:
command (str): The command to parse
Returns:
... |
__init__.py | # -*- coding: utf-8 -*-
"""
Implements context management so that nested/scoped contexts and threaded
contexts work properly and as expected.
"""
from __future__ import absolute_import
from __future__ import division
import collections
import functools
import logging
import os
import platform
import six
import socket
... |
mainwindow.py | """The Qt MainWindow for the QtConsole
This is a tabbed pseudo-terminal of Jupyter sessions, with a menu bar for
common actions.
"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import sys
import webbrowser
from threading import Thread
from jupyter_core.paths i... |
context.py | # coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2015,2019
"""
Context for submission of applications.
********
Overview
********
The main function is :py:func:`submit` to submit
a :py:class:`~streamsx.topology.topology.Topology`
to a Streaming Analytics service or IBM® Streams instance fo... |
adapter.py | from MQTTPubSub import MQTTPubSub
from AMQPPubSub import AMQPPubSub
from google.protobuf import json_format
from google.protobuf.json_format import MessageToDict
import time
import sys
import json
import base64
import threading
import zmq
import os
import importlib.machinery
adaptersDir = os.getcwd() + "/adapters"
c... |
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
=====================================================
Developped and maintained by the Spyder Pro... |
main.py | import numpy as np
import pandas as pd
from bokeh.models import (Div, Tabs, Panel, Slider, Column, TextInput, PreText,
ColumnDataSource, Button, Select, Dropdown)
from bokeh.events import MenuItemClick
from bokeh.plotting import curdoc, figure
from bokeh.layouts import layout, row
from clien... |
mp_.py | import multiprocessing as mp
import time, datetime
from logger import log
from worker import worker
def worker(stock, params):
log("starting " + stock)
time.sleep(10)
log("done with " + stock + " " + str(params))
if __name__ == '__main__':
start = datetime.datetime.now()
processes ... |
ec2_backend.py | import threading
import time
from ec2_observer.event_loop import XOSObserver
from ec2_observer.event_manager import EventListener
from util.logger import Logger, logging
logger = Logger(level=logging.INFO)
class Backend:
def run(self):
try:
# start the openstack observer
obser... |
test_sys.py | import builtins
import codecs
import gc
import locale
import operator
import os
import struct
import subprocess
import sys
import sysconfig
import test.support
from test import support
from test.support import os_helper
from test.support.script_helper import assert_python_ok, assert_python_failure
from test.support imp... |
twitchobserver.py | import codecs
import logging
import os
import re
import socket
import sys
import threading
import time
import warnings
logger = logging.getLogger(__name__)
class BadEvent(Exception):
"""A class that is raised if a bad Twitch chat event occured."""
pass
class Event(object):
"""A class for representing... |
wav_to_ark.py | #!/usr/bin/env python3
# encoding: utf-8
# Copyright 2019 Thai-Son Nguyen
# Licensed under the Apache License, Version 2.0 (the "License")
import os
import argparse
import multiprocessing
import numpy as np
from scipy.io import wavfile
from pynn.util import audio
from pynn.io import kaldi_io
def write_ark_thread(se... |
comparison.py | import multiprocessing as multi
import hashlib
import time
# Function to determine if a number is prime
def is_prime(n):
if n <=1:
return False
for i in range(2, n):
if n % i == 0:
return False
return True
# Function for child process to check primes
def primesFunction(outpu... |
fun_util.py | import cv2, pickle
import numpy as np
import tensorflow as tf
from cnn_tf import cnn_model_fn
import os
import sqlite3, pyttsx3
from keras.models import load_model
from threading import Thread
engine = pyttsx3.init()
engine.setProperty('rate', 150)
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
model = load_model('cnn_model... |
rc.py | #!/usr/bin/env python
import sys
import os
import argparse
import logging
import time
import threading
from fcntl import ioctl
from struct import unpack
from select import select
try:
# noinspection PyPackageRequirements
from evdev import ecodes, InputDevice
except ImportError:
sys.exit("ERROR: This appli... |
rfserver.py | #!/usr/bin/env python
#-*- coding:utf-8 -*-
import os
import sys
import logging
import binascii
import argparse
import time
import copy
import Queue
import threading
from bson.binary import Binary
import rflib.ipc.IPC as IPC
import rflib.ipc.IPCService as IPCService
from rflib.ipc.RFProtocol import *
from rflib.ipc.... |
test_connection.py | # coding=utf-8
from __future__ import unicode_literals
import unittest
from threading import Thread
import datetime
import time
import math
import lore.io.connection
import sqlalchemy
from sqlalchemy import event
from sqlalchemy.engine import Engine
import pandas
import lore
calls = 0
@event.listens_for(Engine, "a... |
report.py | # -*- coding: utf-8 -*-
import base64
import logging
import sys
import threading
import odoo
import odoo.report
from odoo import tools
from odoo.exceptions import UserError
import security
_logger = logging.getLogger(__name__)
# TODO: set a maximum report number per user to avoid DOS attacks
#
# Report state:
# ... |
test_capi.py | # Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
from collections import OrderedDict
import os
import pickle
import random
import re
import subprocess
import sys
import textwrap
import threading
import time
import unitt... |
asyncioscheduler.py | import asyncio
import datetime
import time
from threading import Thread
from rx.core.typing import ScheduledAction, RelativeTime, AbsoluteTime
from rx.disposable import Disposable
from rxbp.scheduler import SchedulerBase
class AsyncIOScheduler(SchedulerBase, Disposable):
def __init__(self, loop: asyncio.Abstrac... |
parallel_download.py | import os
import sys
import requests
import threading
import shutil
import urllib.request
import timeit
import time
import math
import base64
import queue
import crcmod
import re
import pathlib
def get_file_name(url):
"""Get the file name from URL
for OSS downloader
example:
http://{bucket}.oss-cn-she... |
log.py | #!/usr/bin/env python
"""
Copyright (c) 2014-2016 Miroslav Stampar (@stamparm)
See the file 'LICENSE' for copying permission
"""
import os
import signal
import socket
import SocketServer
import sys
import threading
import time
import traceback
from core.common import check_sudo
from core.settings import config
from ... |
Viav020.py | import numpy as np
import pandas as pd
from scipy.sparse import csr_matrix, csgraph
import scipy
import igraph as ig
import leidenalg
import time
import hnswlib
import matplotlib.pyplot as plt
import matplotlib
import math
import multiprocessing
from scipy.sparse.csgraph import minimum_spanning_tree
from scipy import s... |
session.py | import pathlib
import functools
import threading
import push_analyzer.utils.git as git
import push_analyzer.utils.system as system
import push_analyzer.poller
import push_analyzer.analyzer
import push_analyzer.utils.observer
import plugin_manager
plugin_manager.register ()
config = plugin_manager.get ( 'git.config' ... |
main.py | #!/usr/bin/env python3
# Coding: UTF-8
# Author: Sarthak2143
# Source: https://github.com/Sarthak2143/GmailBruteforce
# License: MIT License
try:
import smtplib
except ModuleNotFoundError:
print("smtlib not found, Installing...")
os.system("python3 -m pip install smtblib")
except:
pass
import threa... |
main.py | # -*- coding: utf-8 -*-
"""
@Author : Fang Yao
@Time : 2021/3/24 9:28 上午
@FileName: main.py
@desc: 主程序入口文件
"""
import re
import os
import random
from collections import Counter
import unicodedata
from threading import Thread
import cv2
from Levenshtein import ratio
from PIL import Image
from numpy import average,... |
gst_process.py |
import traceback
import logging
import signal
import threading
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstBase', '1.0')
from gi.repository import GObject, Gst, GLib
Gst.init(None)
# No need to call GObject.threads_init() since version 3.11
# GObject.threads_init()
log = logging.getLogger(__nam... |
presubmit_support.py | #!/usr/bin/env python
# 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.
"""Enables directory-specific presubmit checks to run at upload and/or commit.
"""
from __future__ import print_function
__versio... |
recorder.py | """
Record from the default microphone in an infinite loop and create
a Live Playlist (Sliding Window).
Reference: https://developer.apple.com/documentation/http_live_streaming/
"""
import hashlib
import os
import multiprocessing
import pyaudio
import pydub
from typing import List, Tuple
MEDIAS_DIR: str = os.envir... |
test_io.py | from __future__ import division, absolute_import, print_function
import sys
import gzip
import os
import threading
import shutil
import contextlib
from tempfile import mkstemp, mkdtemp, NamedTemporaryFile
import time
import warnings
import gc
from io import BytesIO
from datetime import datetime
import numpy as np
imp... |
PYTHON_XPATH_paquzhaopian_baocun.py | # 多进程的库
from multiprocessing import Process
from random import randint
from time import time, sleep
import os
import requests
from lxml import etree
def baocun(url):#此方法是将图片保存文件到本地 只需要传入图片地址
try:
root = "D://PYTHON//"#这是根文件所在
path=root+url.split('/')[-1]#通过’/‘把图片的url分开找到最后的那个就是带.jpg的保存起来... |
__init__.py | # -*- coding: utf-8 -*-
"""
keyboard
========
Take full control of your keyboard with this small Python library. Hook global events, register hotkeys, simulate key presses and much more.
## Features
- **Global event hook** on all keyboards (captures keys regardless of focus).
- **Listen** and **send** keyboard event... |
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, overload, Type
from .bui... |
zcooldl.py | # @Author: lonsty
# @Date: 2019-09-07 18:34:18
import json
import math
import os.path as op
import re
import sys
import threading
import time
from collections import namedtuple
from concurrent.futures import ThreadPoolExecutor, as_completed, wait
from datetime import datetime
from pathlib import Path
from queue impor... |
Test_Debug.py | from subprocess import call
from Checker import this_file_exists
import Select_15_min
from Select_15_min import process_stop
import threading
import time
import pytest
import csv
import numpy as np
from multiprocessing.pool import ThreadPool
import subprocess
import os
def llamada(programa,parametros):
i = 0
... |
example0.py | import logging
import os
import multiprocessing
import time
"""Simple example showing the inner workings of celery."""
from celery import Celery
from celery.exceptions import TimeoutError
REDIS_PASSWORD = os.environ.get("REDIS_PASSWORD")
logging.basicConfig(level=logging.DEBUG)
# Main application object shared be... |
config_manager.py | # Copyright 2019-2020, Optimizely
# 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... |
wsdump.py | """
"""
"""
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the... |
fit_periodic.py |
import threading
import tensorflow_probability as tfp
import numpy as np
import tensorflow as tf
import time
import pickle
import pandas as pd
np.set_printoptions(suppress=True,precision=3)
import sys
from tensorflow_probability import distributions as tfd
from move_ns import moveNS
def setup_and_run_hmc(threa... |
daemon_threads.py | # https://www.bogotobogo.com/python/Multithread/python_multithreading_Daemon_join_method_threads.php
import threading
import time
import logging
logging.basicConfig(level=logging.DEBUG,
format='(%(threadName)-9s) %(message)s',)
def n():
logging.debug('Starting')
time.sleep(1)
logging.... |
apps.py | import time
import os
import sys
import logging
from multiprocessing import Process
from django.apps import AppConfig
from django.db.utils import OperationalError
from wizer.file_helper.gpx_parser import GPXParser
from wizer.file_helper.fit_parser import FITParser
from wizer.file_helper.fit_collector import FitCollec... |
downloader.py | """
Support for functionality to download files.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/downloader/
"""
import logging
import os
import re
import threading
import requests
import voluptuous as vol
import homeassistant.helpers.config_validation... |
webserver.py | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
launcher.py | import configparser
import logging
import multiprocessing
from ballisticchat import socketfeed, monitor
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
if __name__ == '__main__':
config_path = './config/settings.conf'
config = configparser.RawConfigParser()
con... |
gui.py | #
# Copyright (C) 2014 Tommy Winther
# http://tommy.winther.nu
#
# Modified for FTV Guide (09/2014 onwards)
# by Thomas Geppert [bluezed] - bluezed.apps@gmail.com
#
# Modified for Baksy IPTV Guide (2016)
# by wardoctor - wardoctor@tardisbuilds.com
#
# This Program is free software; you ca... |
stress.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import multiprocessing
import os
import signal
import subprocess
import s... |
TschunkView.py | import sys
import pyglet
from pyglet.gl import *
import primitives
import utils
from map1 import *
import threading
import time
FPS = 60
smoothConfig = utils.getSmoothConfig()
class TschunkView(pyglet.window.Window):
def mapX(self, x):
return self.cord_origin_x + x * self.x_step
def mapY(self, y):
... |
Threading_time.py | #the timeout passed is less than the amount of time the daemon thread sleeps,
#the thread is still “alive” after join() returns.
import threading
import time
def worker():
print 'Worker'
time.sleep(1)
print 'Exit Worker'
def daemon():
print 'Daemon'
time.sleep(3)
print 'Exit Daemon'
d = threading.... |
linkmonitor.py | import logging
import sched
import threading
import time
from typing import TYPE_CHECKING, Dict, List, Optional, Set, Tuple
from lxml import etree
from core.emulator.data import LinkData
from core.emulator.enumerations import LinkTypes, MessageFlags
from core.nodes.network import CtrlNet
try:
from emane import s... |
core.py | """ coding .:: utf-8 """
import threading
import json
import requests
from .mailer import send_mail
class Pager():
"""
Description:
"""
def __init__(self, spark_context, username, password, host='smtp.gmail.com', port=587):
self.spark_context = spark_context
self.username = username
... |
02_count_dqn_c51_mp.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 30 07:04:13 2020
@author: ayman
"""
import os
import torch
import gym
import ptan
from lib import model, data
import numpy as np
from tensorboardX import SummaryWriter
from collections import Counter
import torch.multiprocessing as mp
import torch.n... |
Run.py | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.proxy import *
import requests
import threadi... |
webcheck.py | import urllib.request
import urllib.error
import time
import threading
import json
from CheckMate.log import logger
def curl_check(address):
try:
t = urllib.request.urlopen(address)
return t
except urllib.error.HTTPError as err:
logger.error("webcheck - HTTP error while connecting to {... |
runServer.py | # encoding: utf-8
# 该文件,为无界面启动文件,以vtServer为容器,加载MainEngine
# 配置:
# self.gateway_name ,gateway 的连接名称,在vtEngine.initGateway()里面定义,对应的配置文件是 "连接名称_connect.json",
# self.strategies:启动的策略实例,须在catStrategy/CtaSetting.json 里面定义 [u'S28_RB1001', u'S28_TFT', u'S28_HCRB',u'atr_rsi']
# vtServer的ZMQ端口: 从VT_Setting.json中配置,根据AU... |
socket-server-testdata.py | #!/usr/bin/python3
import socket
import socketserver
import time
import threading
import os
import re
import sys
################################################################################
# Gloabl variables
MAXBANDWIDTH = 20000
USEDBANDWIDTH = 0
lock = threading.Lock()
# lock.acquire()
# lock.release()
CLIENTL... |
ch06_listing_source.py |
import bisect
from collections import defaultdict, deque
import json
import math
import os
import time
import unittest
import uuid
import zlib
import redis
QUIT = False
pipe = inv = item = buyer = seller = inventory = None
# <start id="_1314_14473_8380"/>
def add_update_contact(conn, user, contact):
ac_list = '... |
StarData.py | from typing import Callable, List, TypeVar, Dict, Optional
from .Error import *
import threading
import uuid
import json
from hashlib import md5
import time
import sys
from os.path import exists, isdir, join
from os import mkdir
import requests
M = TypeVar("M")
class Base:
def __init__(self, api: str, private_ke... |
apdcam10g_control_gui.py | # -*- coding: utf-8 -*-
"""
This is the graphical user interface for measuring with APDCAM-10G
and plotting data using the flap environment
Author: S. Zoletnik zoletnik.sandor@ek-cer.hu
"""
import tkinter as tk
from tkinter import messagebox
import threading
import datetime
import time
import pathlib
import... |
main.py | import time
import random
import math
import threading
import urllib
from statistics import median
from datetime import datetime
from pathlib import Path
from urllib.request import URLError
import neopixel
import constants
from light_sensor import get_ambient_light
from get_flight_conditions import get_metars
# ini... |
ReadsUtilsServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, Inva... |
MKSerial.py | #!/usr/bin/env python
import serial # imports pyserial API
import struct # imports struct API
import sys # sys.exit()
import threading # multithreading
import time # sleep
from MKLogFile import MKLogFileHandler
LF = serial.to_bytes([10])
CR = serial.to_bytes([13])
CRLF = serial.to_bytes([13, 10])
class... |
tello.py | import threading
import socket
import time
import datetime
import struct
import sys
import os
from . import crc
from . import logger
from . import event
from . import state
from . import error
from . import video_stream
from . utils import *
from . protocol import *
from . import dispatcher
log = logger.Logger('Tello... |
flexbe_onboard.py | #!/usr/bin/env python
import roslib; roslib.load_manifest('flexbe_onboard')
import rospy
import rospkg
import os
import sys
import inspect
import tempfile
import threading
import time
import smach
import random
import yaml
import zlib
import xml.etree.ElementTree as ET
from ast import literal_eval as cast
from flexbe... |
binance_plot.py | import time
from datetime import datetime, timedelta
from threading import Thread
import matplotlib
import numpy as np
import pandas as pd
import mplfinance as mpf
import pickle as pk
from binance.exceptions import BinanceAPIException
from matplotlib.path import Path
from mplfinance._styles import _apply_mpfstyle
fro... |
test_new_kvstore.py | import os
import time
import numpy as np
import socket
from scipy import sparse as spsp
import dgl
import backend as F
import unittest
from dgl.graph_index import create_graph_index
import multiprocessing as mp
from numpy.testing import assert_array_equal
if os.name != 'nt':
import fcntl
import struct
def get... |
02_multithreaded.py | from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from requests import Session
from threading import Thread
from time import sleep
name = input("Please enter your name: ")
chat_url = "https://build-system.fman.io/chat"
server = Session()
# GUI:
app = QApplication([])
text_area = QPlainTextEdit()
text_area.setF... |
chat_room.py | # This Python file uses the following encoding: utf-8
import sys
import threading
import time
import socket
import select
import errno
import queue
from PyQt5.QtWidgets import QApplication, QMainWindow, QDialog
from PyQt5 import QtCore, QtGui, QtWidgets
from Dialog_Connect import Ui_Dialog
from Crypto.PublicKey import ... |
currency_config.py | import configparser
import os
import threading
import json
import schedule
import time
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
__all__ = ('currencyConfig', 'CurrencyConfig')
def currencyMapper(item):
return item.get('symbol')
def getCurrencyList():
try:
req = ... |
gpu_usage.py | ################################################################################
# Copyright (c) 2021 ContinualAI. #
# Copyrights licensed under the MIT License. #
# See the accompanying LICENSE file for terms. ... |
vectorized_env_executor.py | import numpy as np
import pickle as pickle
from multiprocessing import Process, Pipe
import copy
from simAdapter import terrainRLSim
from meta_policy_search.envs.normalized_env import normalize
class MetaIterativeEnvExecutor(object):
"""
Wraps multiple environments of the same kind and provides functionality... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.