source
stringlengths
3
86
python
stringlengths
75
1.04M
daemon_thread.py
# coding: utf-8 ######################################################################### # 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> # # author yeeku.H.lee kongyeeku@163.com # # # # version 1.0 ...
gui.py
#!/usr/bin/env python3 import asyncio import threading from functools import partial from tkinter import * from tkinter import ttk from tkinter import filedialog from tkinter import messagebox import os import sys import json import database import option sync_list = [] remotes_list = [] providers_list = [] tabs = {} ...
app.py
import json import logging import os import requests import time import threading import queue from requests import RequestException from chatbot.algorithm.question_answering.agent import Agent logging.basicConfig(filename='speakeasy.log', encoding='utf-8', level=logging.DEBUG) class App: def __init__(self): ...
parallel_utils.py
import queue import concurrent.futures import os import sys import threading from typing import Iterable, Optional def ensure_single_thread_numeric(): """ When you parallelize your input pipeline you often want each worker to work on a single thread. These are all candidates to set to 1, but the ones...
test_transaction.py
#!/usr/bin/env python # test_transaction - unit test on transaction behaviour # # Copyright (C) 2007-2011 Federico Di Gregorio <fog@debian.org> # # psycopg2 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 Foundat...
PPO_run.py
#!/usr/bin/env python3 import threading, queue import time import os import shutil import numpy as np import math import rospy from ppo import PPO from env_v5 import Test MAX_EPISODES = 100000 MAX_EP_STEPS = 400 MEMORY_CAPACITY = 10000 SIDE = ['right_', 'left_'] GOAL_REWARD = 1500 LOAD = False def train(nameIndx): ...
rgbmatrix.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020-2021 by Murray Altheim. All rights reserved. This file is part # of the Robot Operating System project, released under the MIT License. Please # see the LICENSE file included as part of this package. # # author: Murray Altheim # created: 2020-03-16 # ...
naoqi_2d_simulator.py
# -*- coding: utf-8 -*- import sys import os import argparse import matplotlib.pyplot as plt import matplotlib.patches as patches import matplotlib.animation as animation import math import numpy as np from numpy.random import * from scipy.interpolate import interpolate from socket_server import * import threading DT ...
blescannerbleak.py
#!/usr/bin/env python3 import sys sys.path.append('..') import ble_temperature_sensor from time import sleep import logging import threading import time # bluetooth import bleak import asyncio import re class BluetoothScannerBleak(): updatetime = 60 sensors = [] sensorLabels = {} verbose = False ...
recorder.py
#!/usr/bin/env python import tornado.httpserver import tornado.ioloop import tornado.web import threading from tornado.options import options from settings import settings from urls import url_patterns from util import make_trace_folder class DataRecorder(tornado.web.Application): def __init__(self): to...
dag_processing.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...
shared_count.py
from threading import Thread, Semaphore import time # shared count value count = 0 def thread_finished(current_count=None): print "count:", current_count class Incrementer(object): def __init__(self, mutex): self.mutex = mutex def run(self): global count self.mutex.acquire...
worker.py
# coding:utf-8 import threading import six.moves.urllib as urllib import six.moves.urllib.request import json MASTER_ADDRESS = "http://58.198.176.33:8081" TASK_URL = MASTER_ADDRESS + "/worker/task" HERAT_BEAT_URL = MASTER_ADDRESS+"/worker/status" TIMEOUT_LIMIT = 30 class Worker: """ Try to keep Worker thread ...
main.py
# main.py # author: Playinf # email: playinf@stu.xmu.edu.cn import os import ops import sys import copy import argparse import numpy as np import tensorflow as tf import multiprocessing from utils import parallel_model from utils.validation import validate from data.record_reader import get_input_fn from data.plain_t...
ssdpot.py
#!/usr/bin/env python3 import os import signal import threading from . import ssdp import core.potloader as potloader import core.utils as utils from .dblogger import DBThread class SSDPot(potloader.PotLoader): """ Implementation of SSDP honeypot that responds to M-SEARCH requests. """ def name(self): ...
cam_tk.py
import tkinter as tk import cv2 from PIL import Image from PIL import ImageTk import threading import os class MainWindow(): def __init__(self, window, cap): self.window = window self.cap = cap self.width = self.cap.get(cv2.CAP_PROP_FRAME_WIDTH) self.height = self.cap.get(cv2.CA...
EWSv2.py
import email import hashlib import subprocess import warnings from collections import deque from multiprocessing import Process import exchangelib from CommonServerPython import * from cStringIO import StringIO from exchangelib import (BASIC, DELEGATE, DIGEST, IMPERSONATION, NTLM, Account, Bod...
task.py
import atexit import json import os import shutil import signal import sys import threading import time from argparse import ArgumentParser from logging import getLogger from operator import attrgetter from tempfile import mkstemp, mkdtemp from zipfile import ZipFile, ZIP_DEFLATED try: # noinspection PyCompatibili...
prepro.py
#! /usr/bin/python # -*- coding: utf-8 -*- import copy import threading import time import numpy as np import tensorlayer as tl import scipy import scipy.ndimage as ndi from scipy import linalg from scipy.ndimage.filters import gaussian_filter from scipy.ndimage.interpolation import map_coordinates import skimag...
generate.py
import argparse import datetime import glob import logging import os import random import signal import sys import threading import time from typing import List, Union import yaml from jsonschema import validate, ValidationError class Generator: def __init__(self, conf_dir: str, truncate: bool = False): ...
mp_slipmap.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' slipmap based on mp_tile Andrew Tridgell June 2012 ''' import functools import math import os, sys import time try: import cv2.cv as cv #import cv2 as cv except ImportError: import cv from MAVProxy.modules.mavproxy_map import mp_elevation from MAVProxy.mo...
tweet.py
from env import * import twitter import pprint import random import time from multiprocessing import Process api = twitter.Api(consumer_key=CONSUMER_KEY, consumer_secret=CONSUMER_SECRET, access_token_key=ACCESS_TOKEN, access_token_secret=ACCESS_TOKEN_SECRET) de...
helpers.py
# -*- coding: utf-8 -*- ''' :copyright: Copyright 2013-2017 by the SaltStack Team, see AUTHORS for more details. :license: Apache 2.0, see LICENSE for more details. tests.support.helpers ~~~~~~~~~~~~~~~~~~~~~ Test support helpers ''' # pylint: disable=repr-flag-used-in-string,wrong-import-order ...
manager.py
#!/usr/bin/env python2.7 import os import sys import fcntl import errno import signal if __name__ == "__main__": if os.path.isfile("/init.qcom.rc") \ and (not os.path.isfile("/VERSION") or int(open("/VERSION").read()) < 4): raise Exception("NEOS outdated") # get a non-blocking stdout child_pid, child_...
utils.py
from pyteomics import fasta, parser from multiprocessing import Queue, Process, cpu_count import os import csv import subprocess from scipy.stats import binom import numpy as np import pandas as pd def recalc_spc(banned_dict, unstable_prots, prots_spc2): tmp = dict() for k in unstable_prots: tmp[k] = s...
windows.py
import argparse import cPickle as pickle import os import platform import socket import SocketServer import threading import time from collections import OrderedDict from pydivert.windivert import WinDivert from pydivert.enum import Direction, Layer, Flag PROXY_API_PORT = 8085 class Resolver(object): def __in...
zhuzhewang.py
#!/usr/bin/python # -*- coding: UTF-8 -*- import urllib import urllib2 import re import requests from lxml import etree #from bs4 import BeautifulSoup import chardet import xlwt #from xlwt import * import sys import os import traceback import requests import Queue import time import threading myQueue = Queue.Queue...
DirectLinkDownloader.py
'''Icon used is made by Freepik (https://www.freepik.com) from www.flaticon.com ''' from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import QMessageBox import logging import requests from bs4 import BeautifulSoup from getpass import getuser import threading from pyperclip import copy class CustomExcept...
vector_envs.py
import copy import multiprocessing as mp from abc import ABC, abstractmethod from typing import Any, Iterator, List, Tuple import gym import numpy as np def worker(parent_conn: mp.Pipe, child_conn: mp.Pipe, env: gym.Env): """ Worker class to facilitate multiprocessing :param parent_conn: Parent connecti...
test_strategy.py
""" """ import threading import time import unittest import hiro import redis import pymemcache.client from limits.limits import RateLimitItemPerSecond, RateLimitItemPerMinute from limits.storage import ( MemoryStorage, RedisStorage,MemcachedStorage ) from limits.strategies import ( MovingWindowRateLimiter, ...
configurationManager.py
#------------------------------------------------------------------------------- # Copyright 2006-2012 UT-Battelle, LLC. See LICENSE for more information. #------------------------------------------------------------------------------- from configobj import ConfigObj import shutil import os import sys import imp import...
test_fft.py
import functools import unittest import pytest import numpy as np import cupy from cupy import testing from cupy.fft import config from cupy.fft.fft import (_default_fft_func, _fft, _fftn, _size_last_transform_axis) def nd_planning_states(states=[True, False], name='enable_nd'): """Dec...
tcr.py
# -*- coding: utf-8 -*- import LINETCR from LINETCR.lib.curve.ttypes import * from datetime import datetime import time,random,sys,json,codecs,threading,glob,re cl = LINETCR.LINE() #cl.login(qr=True) cl.login(token="EvzWRUlQi2qVdvxT1TDb.0PzLwS72Fl1EGGJMnIN3IW.XCQH4jCs+dM1ip6oAbLChXXF0KSaBccoZeOF7okmDqU=") cl.loginRes...
mon.py
# -*- coding: utf-8 =*- from celery import shared_task import time,string from django.template import loader from dbmanage.myapp.models import MySQL_monitor from dbmanage.myapp.models import Db_instance,Db_account import MySQLdb,datetime from dbmanage.myapp.include.encrypt import prpcrypt from dbmanage.myapp.tasks impo...
r3ptar.py
#!/usr/bin/env python3 import time import threading import signal import ev3dev.ev3 as ev3 def tail_waggler(done): """ This is the first thread of execution that will be responsible for waggling r3ptar's tail every couple of seconds. """ m = ev3.MediumMotor(); assert m.connected while not don...
mxs_token.py
''' Demonstrates the use of mxstoken ''' import threading import time import pymxs # pylint: disable=import-error def mxstoken_sample(): ''' Demonstrate 3 threads using mxstoken. ''' flag = True counter = 0 def call_mxs_entry(): ''' Access pymxs in a mxstoken protected block...
test.py
#import gevent.monkey #gevent.monkey.patch_socket() from pyEtherCAT import MasterEtherCAT import time import os import signal import aseqdump import threading #============================================================================ # C95用の簡易EtherCATパッケージです。 # 本来は細かいパケットに付いて理解を深めた上で仕組みを構築していきますが、 # 説明も実験も追いつかず、ひとま...
config_test.py
# coding=utf-8 # Copyright 2018 The Gin-Config Authors. # # 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 la...
HiwinRA605_socket_ros_20190604111411.py
#!/usr/bin/env python3 # license removed for brevity #接收策略端命令 用Socket傳輸至控制端電腦 import socket ##多執行序 import threading import time ## import sys import os import numpy as np import rospy import matplotlib as plot from std_msgs.msg import String from ROS_Socket.srv import * from ROS_Socket.msg import * import HiwinRA605_s...
qactabase.py
import copy import datetime import json import os import re import sys import threading import time import uuid import pandas as pd import pymongo import requests from qaenv import (eventmq_amqp, eventmq_ip, eventmq_password, eventmq_port, eventmq_username, mongo_ip, mongo_uri) from QAPUBSUB.consume...
square_1.py
import os from multiprocessing import Process, current_process def square(number): result=number**2 process_id=os.getpid() print("process ID is {}".format(process_id)) print("process name is {}".format(current_process().name)) print("the number {} squares to {}".format(number,result)) if __name__=...
email.py
from threading import Thread from flask import current_app, render_template from flask.ext.mail import Message from . import mail def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_email(to, subject, template, **kwargs): app = current_app._get_current_object() msg = ...
scriptinfo.py
import os import sys from copy import copy from datetime import datetime from functools import partial from tempfile import mkstemp, gettempdir import attr import logging import json from pathlib2 import Path from threading import Thread, Event from .util import get_command_output, remove_user_pass_from_url from .......
executormarionette.py
import hashlib import httplib import os import socket import threading import time import traceback import urlparse import uuid from collections import defaultdict from ..wpttest import WdspecResult, WdspecSubtestResult errors = None marionette = None pytestrunner = None here = os.path.join(os.path.split(__file__)[0...
presenter_socket_server.py
# ======================================================================= # # Copyright (C) 2018, Hisilicon Technologies Co., Ltd. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1 Redistrib...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import asyncio from typing import TYPE_CHECKING, Optional, Union, Callable, Sequence from electrum.storage import WalletStorage, StorageReadWriteError from electrum.wallet_db import WalletDB from el...
test_io.py
from __future__ import division, absolute_import, print_function import sys import gzip import os import threading import time import warnings import io import re import pytest from tempfile import NamedTemporaryFile from io import BytesIO, StringIO from datetime import datetime import locale import numpy as np impor...
test01.py
# encoding: utf-8 import serial import Queue import threading import struct import time def check_sum(data): if len(data) < 5: return False s = 0 for i in range(3, len(data) - 1): s += data[i] return (s & 0xff) == data[len(data) - 1] def do_imu(data): # acc ax = struct.unpac...
udp.py
import sys import socket import threading import status _kill = False _relayport = 0 _remoteaddress = "" _remoteport = 0 def relay(): sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.bind(("0.0.0.0", _relayport)) incomingsetup = False clientport = 0 clientip = "" while True: data, fromaddr = soc...
camxy.py
#!/usr/bin/env python3 import socket import picamera as pc import time import serial import threading as th import sys import io stp=th.Event() #Major stop flag for clean exit strmlive=th.Event() def streaminit(): sock=socket.socket() try: sock.bind(("0.0.0.0",8000)) except: stp.set() strmlive.set() print...
progress.py
''' Show progress of the transcoding job ''' from threading import Lock, Thread from time import sleep class ThreadSafeCounter: ''' A counter that can be safely incremented by multiple threads ''' def __init__(self, initial=0): self.value = initial self.lock = Lock() def incr...
img_analyse.py
from imageio import imread, imsave from detector import timestamp import multiprocessing as mp import math import numpy as np import time import os folder = "data" def get_pixels(img): pixels = imread(img, as_gray=False, pilmode='L') return pixels def analyse(name, data): threshold = np.average(data) +...
__init__.py
#!/usr/bin/env python2 """ freaklabs zigbee sniffer source accepts standard source hop options accepts additional options: device=/path/to/serial baud=baudrate band=800|900|2400 Based in part on the Sensniff code from: https://github.com/freaklabs/sensniff-freaklabs.git Under the following license: Copyright (c) ...
websocket.py
import uuid import json import threading import logging from tornado import websocket, ioloop from tornado.web import Application from tornado.httpserver import HTTPServer from .zmqsub import Subscriber from .. import protocol from .wsmanager import WebSocketManager log = logging.getLogger(__name__) class WebSock...
walker.py
#!/usr/bin/env python from threading import Thread import rospy import math from phantomx_gazebo.phantomx import PhantomX from geometry_msgs.msg import Twist jleg = ['j_c1', 'j_thigh', 'j_tibia'] suffix = ['f', 'm', 'r'] sides = ['l', 'r'] joints = [] for j in jleg: #fill up joint information for whole robot body ...
__init__.py
"""Hermes MQTT server for Rhasspy wakeword with snowboy""" import asyncio import io import logging import queue import socket import threading import typing import wave from dataclasses import dataclass, field from pathlib import Path from rhasspyhermes.audioserver import AudioFrame from rhasspyhermes.base import Mess...
stats.py
#!/usr/bin/env python3 # coding=utf-8 # # Python Script # # Copyleft © Manoel Vilela # # import pandas as pd # sudo pip install pandas import numpy as np # sudo pip install numpy from distutils.spawn import find_executable from optparse import OptionParser from os import path import os import time import iterto...
meshping.py
#!/usr/bin/python # -*- coding: utf-8 -*- # kate: space-indent on; indent-width 4; replace-tabs on; from __future__ import division import os import math import socket import os.path import json from oping import PingObj, PingError from optparse import OptionParser from redis import StrictRedis from thread...
EmbedWindow_DockExample.py
from tkinter import * from robodk.robolink import * import tkinter import threading # Create a new window window = tkinter.Tk() # Close the window def onClose(): window.destroy() quit(0) # Trigger Select button # IMPORTANT: We need to run the action on a separate thread because # (otherwise, if we want to ...
pulse_launch.py
# Copyright (c) 2021 Philipp Hochkamp # # 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, di...
notify.py
import platform import os import pathlib import threading from loguru import logger class Notify: def __init__( self, default_notification_title="Default Title", default_notification_message="Default Message", default_notification_application_name="Python Application (notify.py)"...
base.py
import sys import re from subprocess import PIPE, Popen, STDOUT from threading import Thread import os import os.path import tempfile import shlex from Queue import Queue, Empty ON_POSIX = 'posix' in sys.builtin_module_names __all__ = [ "Process", "AirpnpProcess", ] def enqueue_output(out, queue): for ...
email.py
# -*- coding: utf-8 -*- from threading import Thread from flask import current_app, render_template from flask_mail import Message from . import mail def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_email(to, subject, template, **kwargs): app = current_app._get_current...
__init__.py
from queue import Queue from threading import Thread import numpy as np import tensorflow as tf from nboost.plugins.models.rerank.tf.albert import modeling, tokenization as bert_tokenization from nboost.plugins.models.rerank.base import RerankModelPlugin class AlbertRerankModelPlugin(RerankModelPlugin): def __in...
potplayer_advanced.py
# Copyright (c) 2021 by xfangfang. All Rights Reserved. # # Using potplayer as DLNA media renderer # # Macast Metadata # <macast.title>PotPlayer Advanced</macast.title> # <macast.renderer>PotplayerRenderer</macast.title> # <macast.platform>win32</macast.title> # <macast.version>0.4</macast.version> # <macast.host_versi...
websocket.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 License, ...
managers.py
# # Module providing the `SyncManager` class for dealing # with shared objects # # multiprocessing/managers.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # from __future__ import absolute_import from __future__ import with_statement __all__ = ['BaseManager', 'SyncManager', ...
webServer.py
#!/usr/bin/env/python # File name : server.py # Production : GWR # Website : www.adeept.com # Author : William # Date : 2020/03/17 import time import threading import move import Adafruit_PCA9685 import os import info import RPIservo import functions import robotLight import switch import socket #...
docker_utils.py
# def pull_image(image): # registry = image.split(":")[0] # image_tag = image.split(":")[1] # client = docker.APIClient(base_url='unix://var/run/docker.sock') # logger.info("Start pulling image: %s" % image) # return client.pull(registry, image_tag) # def run_server(image, mem_limit=None, timeout=...
update_manifest_test.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. """Unit tests for update_manifest.py.""" __author__ = 'mball@google.com (Matt Ball)' import errno import os import SimpleHTTPServ...
MetadataGUI.py
import os import threading from tkinter import * from tkinter import messagebox from PIL import ImageTk, Image from Metadata import get_metadata, getSongsList from tkinter.filedialog import askopenfilename class MetadataGUI: def __init__(self, tk_root: Tk): tk_root.resizable(width=False, height=False) ...
threaded_runner.py
# Copyright 2017 reinforce.io. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
Reglas.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from DF import * from R import * import Utils as utils import threading from functools import wraps import asyncio from concurrent.futures import ThreadPoolExecutor _DEFAULT_POOL = ThreadPoolExecutor(5) def threadpool(f, executor = None): @wraps(f) def wrap(*arg...
installwizard.py
import os import sys import threading import traceback from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from electroncash import Wallet, WalletStorage from electroncash.util import UserCancelled, InvalidPassword from electroncash.base_wizard import BaseWizard from electroncash.i18n ...
sob_main.py
#!/usr/bin/env python import datetime import math import operator import optparse import os import uuid import re import sys import threading import time import webbrowser from collections import namedtuple, OrderedDict, defaultdict from functools import wraps from getpass import getpass from io import TextIOWrapper ...
reco.pyw
# --------------- # # Reco PC Server | # --------------- # # Version No: 6.0 | # --------------- # # Basic bot dependencies import discord from discord.ext.commands import Bot import platform import os import asyncio from threading import Thread # Import configurations import configs # Import helpers from lib.help...
driver.py
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # Copyright (c) 2011 Piston Cloud Computing, Inc # Copyright (c) 2012 University Of Minho # (c) Copyright 2013 Hewlett-Pa...
views.py
from threading import Thread import Queue from django.core.urlresolvers import reverse from django.conf import settings from django import forms from django.http import HttpRequest from django.test import TestCase import haystack from haystack.forms import model_choices, SearchForm, ModelSearchForm from haystack.query ...
prefixtree.py
import multiprocessing as mp from typing import Dict from typing import List from typing import NoReturn import pytricia import redis import requests import ujson as json from artemis_utils import flatten from artemis_utils import get_ip_version from artemis_utils import get_logger from artemis_utils import search_wor...
__init__.py
#### PATTERN | WEB ################################################################################# # Copyright (c) 2010 University of Antwerp, Belgium # Author: Tom De Smedt <tom@organisms.be> # License: BSD (see LICENSE.txt for details). # http://www.clips.ua.ac.be/pages/pattern ####################################...
proxier.py
import atexit from concurrent import futures from dataclasses import dataclass import grpc import logging from itertools import chain import json import psutil import socket import sys from threading import Lock, Thread, RLock import time from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple import r...
test_c10d.py
import copy import logging import math import operator import os import random import signal import sys import tempfile import threading import time import traceback import unittest from unittest import mock from contextlib import contextmanager from datetime import timedelta from functools import reduce from itertools...
app.py
############################################################################### # # The MIT License (MIT) # # Copyright (c) 2014 Miguel Grinberg # # Released under the MIT license # https://github.com/miguelgrinberg/flask-video-streaming/blob/master/LICENSE # ############################################################...
main.py
#!/usr/bin/python __author__ = 'Luca' '''///////////////////////////////////////////////////////////////////////////// // brief Broentech Gateway Test // // author Luca Petricca // // date 22.09.2015 // // par Copyright: The MIT License (MIT) //Copyright (c) 2016 Broentech Solutions A.S., Norway /...
flickmagnet.py
#!/usr/bin/env python3 # config import config # sub processes import httpd import logging import sys import os import time import platform from multiprocessing import Process def main(): logging.basicConfig( filename = os.path.join(config.cache_dir, config.app_name + '.log'), level=logging.DEBUG, format...
test_xmlrpc.py
import base64 import datetime import sys import time import unittest import xmlrpclib import SimpleXMLRPCServer import mimetools import httplib import socket import StringIO import os import re from test import test_support try: import threading except ImportError: threading = None try: ...
__init__.py
#!/usr/bin/env python """ __init__.py - jenni Init Module Copyright 2009-2013, Michael Yanovich (yanovich.net) Copyright 2008-2013, Sean B. Palmer (inamidst.com) Licensed under the Eiffel Forum License 2. More info: * jenni: https://github.com/myano/jenni/ * Phenny: http://inamidst.com/phenny/ """ import sys, os, t...
track.py
import threading import queue import time class track_cmd(object): """docstring for track""" def __init__(self, _id): super(track_cmd, self).__init__() self.q = queue.Queue() self.stop = True self._msg = {"id": _id, "stat": None} def start(self): self.stop = False ...
analyse_result_hrsc.py
import pickle import os from pycocotools.coco import COCO import cv2 import shutil import numpy as np from DOTA_devkit.dota_evaluation import voc_eval, coco_eval from DOTA_devkit.ResultMerge import mergebypolywithnms from DOTA_devkit.ResultMerge_multi_process import mergebypoly as mergebypoly_multi_process import json ...
file_stream.py
""" Parses a file containing pretty-printed json objects as produced by Twitter. For example: { ... some tweet json }, { ... some other tweet json }, """ import time import os import json import logging import threading import twitter_monitor from twitter_stream import models logger = logging.getLogger(__na...
relogger.py
""" Relogger server to read UDP logs from multiple sources. """ import threading import SocketServer from Queue import Queue from syslog import Syslog class RLServer(object): def __init__(self, flowtable): self.flowtable = flowtable self.message_queue = Queue() @property def flowtable(se...
tello_control.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import time import threading import random import numpy as np import rospy from std_msgs.msg import String from cv_bridge import CvBridge, CvBridgeError from sensor_msgs.msg import Image # if you can not find cv2 in your python, you can try this. usually happen...
misc.py
# -*- coding: utf-8 -*- """Some miscellaneous utility functions.""" # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD-3-Clause from contextlib import contextmanager import fnmatch import gc import inspect from math import log import os from queue import Queue, Empty from string import Format...
ploting.py
import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import threading def plot_fam(data,output): ax=sns.barplot(x=data['samples'],y=data['frequency'],hue=data['family']) ax.set(xlabel='Samples', ylabel='Frequency') plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0., title='Fam...
_channel.py
# Copyright 2016 gRPC authors. # # 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...
test_debug.py
import importlib import inspect import os import re import sys import tempfile import threading from io import StringIO from pathlib import Path from unittest import mock from django.core import mail from django.core.files.uploadedfile import SimpleUploadedFile from django.db import DatabaseError, connection from djan...
test_zeromq.py
# -*- coding: utf-8 -*- ''' :codeauthor: Thomas Jackson <jacksontj.89@gmail.com> ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import time import threading import multiprocessing import ctypes from concurrent.futures.thread import ThreadPoolExecutor # ...
__init__.py
import builtins import contextlib import errno import glob import importlib.util from importlib._bootstrap_external import _get_sourcefile import marshal import os import py_compile import random import shutil import stat import subprocess import sys import textwrap import threading import time import unittest from uni...
server.py
from multiprocessing import Process, Pipe import text_classifier import temas from flask import Flask from flask import request from flask import render_template from flask import jsonify # procesamos los datos en un hilo aparte def thread(conn): general_model = text_classifier.load("models/model.pkl") models ...
assistant_library_with_button_demo.py
#!/usr/bin/env python3 # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...