source
stringlengths
3
86
python
stringlengths
75
1.04M
queue_channel.py
# -*- coding: utf-8 -*- # Copyright © 2017 Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can # be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause # Copyright (c) 2008-2013 by Vinay Sajip. # All rights reserved. # # Redistribution ...
logger_item.py
# Software License Agreement (BSD License) # # Copyright (c) 2012, Fraunhofer FKIE/US, Alexander Tiderko # 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 mus...
mssqlclient.py
#!/usr/bin/env python # # Copyright (c) 2020 BlackArrow # # # This product includes software developed by # SecureAuth Corporation (https://www.secureauth.com/). # # Description: [MS-TDS] & [MC-SQLR] example. # # Original author: # Alberto Solino (beto@coresecurity.com/@agsolino) # # Author: # Pablo Martinez (https:/...
arpspoof.py
# Source: https://github.com/ickerwx/arpspoof import sys import threading from Queue import Queue import time from scapy.all import * class ARPspoof: # index values into tuples IP = CMD = 0 MAC = TARGET = 1 # Colours for print __GREEN = '\033[92m' __RED = '\033[91m' __ENDC = '\033[0m' ...
duel.py
import logging, coloredlogs from threading import Thread from random import randrange from modules.config import * from modules.database import Database from modules.timer import Timer database = Database(db_host, db_user, db_pass, db_name, db_autocommit) database.database_connection() class Duel: CommandMain = 'd...
generate-data.py
import os import urllib2 import email.utils as eut import json import cv2 import process_bgs from threading import Thread, Lock from time import sleep relevantCams = [ #"KA091", #"KA061", #"KA041", #"KA151" "K11" ] showPreview = False printMutex = Lock() def printLocked(text): printMutex.acqu...
car_helpers.py
import os import threading import requests from common.params import Params, put_nonblocking from common.basedir import BASEDIR #from selfdrive.version import is_comma_remote, is_tested_branch from selfdrive.car.fingerprints import eliminate_incompatible_cars, all_legacy_fingerprint_cars from selfdrive.car.vin import g...
Misc.py
## @file # Common routines used by all tools # # Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the lic...
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 from keras.models import load_model import constants from PIL import Image, ImageTk from threading import Thread import util import time import pyttsx3 speaking = True vstream = raw = None os.environ...
makedecadescounts.py
import argparse import numpy as np from multiprocessing import Process, Queue import collections from Queue import Empty from ioutils import mkdir, write_pickle, load_pickle def worker(proc_num, queue, out_dir, in_dir): while True: try: decade = queue.get(block=False) except Empty: ...
test_multiprocessing.py
from declarativeunittest import * from construct import * from construct.lib import * def worker(q): obj = q.get() print(obj) def test_multiprocessing(): import multiprocessing queue = multiprocessing.Queue() p = multiprocessing.Process(target=worker, args=(queue,)) p.start() obj = Co...
seeder.py
from Node import Seeder import socket as s import threading as th import json import time import sys from tkinter import * import encrypt as e import getipv6 enc=e.MYcrypt() alias=sys.argv[1] S=s.socket(s.AF_INET6,s.SOCK_DGRAM) HOST=getipv6.HOST S.setsockopt(s.SOL_SOCKET,s.SO_REUSEADDR,1) S.bind((HOST,6969)) print(...
variable_scope.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
pro6.py
# -*- coding: utf-8 -*- import LINETCR from LINETCR.lib.curve.ttypes import * from datetime import datetime from bs4 import BeautifulSoup import time, random, sys, re, os, json, subprocess, threading, string, codecs, requests, tweepy, ctypes, urllib, urllib2, wikipedia,tempfile,glob,shutil,unicodedata,goslate from gtt...
test_c10d_common.py
# Owner(s): ["oncall: distributed"] import copy import os import sys import tempfile import threading import time import unittest from datetime import timedelta from itertools import product from sys import platform import torch import torch.distributed as c10d if not c10d.is_available(): print("c10d not availab...
test_smtplib.py
import asyncore import base64 import email.mime.text from email.message import EmailMessage from email.base64mime import body_encode as encode_base64 import email.utils import hmac import socket import smtpd import smtplib import io import re import sys import time import select import errno import textwrap import thre...
test_PROTON_1800_syncrequestresponse_fd_leak.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...
settings.py
# Copyright 2017 Mycroft AI 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 writin...
noui.py
import multiprocessing from time import sleep from datetime import datetime, time from logging import INFO from vnpy.app.data_recorder import DataRecorderApp from vnpy.event import EventEngine from vnpy.trader.setting import SETTINGS from vnpy.trader.engine import MainEngine from vnpy.gateway.ctp import CtpGateway fr...
client.py
import asyncio import logging import sys import time from threading import Thread, Event from typing import Union, List, Tuple from asyncio import Transport, Protocol from bs4 import BeautifulSoup import kik_unofficial.callbacks as callbacks import kik_unofficial.datatypes.exceptions as exceptions import kik_unofficia...
lisp.py
# ----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com> # # 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...
Startup.py
try: import sys import os import zipfile zippedLib = os.environ["ZIPPEDLIB"] destDir = os.path.expanduser("~/Library/python38") if not os.path.isdir(destDir): with zipfile.ZipFile(zippedLib, "r") as zip_ref: zip_ref.extractall(destDir) sys.path.insert(-1, os.path.expan...
hypothesis_test.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import copy import time from functools import partial, reduce from future.utils import viewitems, viewkeys from hypothesis import assume, given, settings, HealthCheck import hypothesis.strate...
hopper-v2.py
import os, sys, signal import random import numpy as np from multiprocessing import Process, Queue, current_process, freeze_support import argparse parser = argparse.ArgumentParser() parser.add_argument('--pgmorl', default=False, action='store_true') parser.add_argument('--ra', default=False, action='store_true') pars...
ece565hw03code.py
#!/usr/bin/python # Daniel Noyes, ECE565F2015 HW#3 # # HW#3 Simulate a virtual memory system with multiprogramming, # e.g., Pthreads. Assume that your machine has 4-bit virtual # addresses and 8-bit physical address with 2 Byte page size. # You need to implement two processes/threads: # 1) Virtual Address Generation...
midi_hub.py
# Copyright 2018 The Magenta 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 ...
_test_multiprocessing.py
# # Unit tests for the multiprocessing package # import unittest import unittest.mock import queue as pyqueue import time import io import itertools import sys import os import gc import errno import signal import array import socket import random import logging import subprocess import struct import operator import p...
server.py
import time import func_packages.RingRobotX_Web.server.Websocket import tornado.ioloop import tornado.web import model.config import threading import asyncio import json import func_packages.RingRobotX_ChatHistory.main import bcrypt class BaseHandler(tornado.web.RequestHandler): def get_current_user(self): ...
models.py
# coding=utf-8 import json import logging import random import signal from datetime import datetime, timedelta from enum import IntEnum from itertools import chain from threading import Thread from time import sleep import six from django.conf import settings from django.db import DatabaseError from django.db import m...
litex_server.py
#!/usr/bin/env python3 # # This file is part of LiteX. # # Copyright (c) 2015-2021 Florent Kermarrec <florent@enjoy-digital.fr> # Copyright (c) 2019 Sean Cross <sean@xobs.io> # Copyright (c) 2018 Felix Held <felix-github@felixheld.de> # SPDX-License-Identifier: BSD-2-Clause import argparse import os import sys impor...
main.py
import time import os import threading import urllib.request import json import sys import config import praw from slugify import slugify from imgurpython import ImgurClient reddit = praw.Reddit(client_id=config.client_id, client_secret=config.client_secret, user_agent=config.user_agent) reddit.read_only = True # m...
detector_utils.py
# Utilities for object detector. import numpy as np import sys import tensorflow as tf import os from threading import Thread from datetime import datetime import cv2 from utils import label_map_util from collections import defaultdict detection_graph = tf.Graph() sys.path.append("..") # score threshold for showing...
api_pipes.py
from multiprocessing import Process, Pipe from flask_socketio import SocketIO, emit from flask import Flask, render_template import time import json data = { 'local_elevator': { 'up': False, 'down': False, 'floor': '--' }, 'express_elevator': { 'up': False, 'down': ...
test_modern.py
'''cping.layouts.modern tests''' # pylint: disable=not-an-iterable,unsubscriptable-object import curses import threading import unittest import unittest.mock import cping.layouts.modern import cping.protocols # Regarding `list(window.mock_calls[x])[0][y]`, this is a workaround to pre-3.8 class TestLayout(unittest.T...
graphql.py
import sublime import sublime_plugin import re import sys import traceback from threading import Thread from ..deps import requests from ..deps.graphql.parser import GraphQLParser from ..deps.graphql.lexer import GraphQLLexer from ..core import RequestCommandMixin from ..core.parsers import parse_requests from ..cor...
spin.py
# -*- coding=utf-8 -*- import functools import os import signal import sys import threading import time import colorama import cursor import six from .compat import to_native_string from .termcolors import COLOR_MAP, COLORS, colored, DISABLE_COLORS from io import StringIO try: import yaspin except ImportError: ...
set_cmdstan_loc.py
# -*- coding: utf-8 -*- """ Created on Mon May 14 11:03:18 2018 @author: pscog """ from PyThurstonian import thurstonian, run_sample from simulate_data import simulate_data import ranking as rk import numpy as np import pandas as pd from multiprocessing import Process if __name__ == '__main__': #Load and ...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
test_elasticsearch.py
# Copyright The OpenTelemetry 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 ...
ipc-server.py
#!/usr/bin/env python import sys import os import time import threading import zmq # Machinekit specific, can only use on local machine from machinekit import config # Machinetalk bindings from pymachinetalk.dns_sd import ServiceDiscovery, ServiceDiscoveryFilter from pymachinetalk.application import ApplicationStatus...
io.py
# coding: utf-8 # pylint: disable=invalid-name, protected-access, fixme, too-many-arguments, W0221, W0201, no-self-use, no-member """NDArray interface of mxnet""" from __future__ import absolute_import from collections import OrderedDict, namedtuple import sys import ctypes import logging import threading import nump...
App.py
import tkinter as tk import numpy as np import tkinter.filedialog import threading import MLPV3 class App(): def __init__(self): self.args = [] self.running = False # Create the root window. self.root = tk.Tk() self.root.title("Neural Net Visualization") self.root.geometry("%dx%d+0+0" % (self.root.winfo...
job_worker.py
########################################################################### # # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/...
reloader_helpers.py
import os import sys import signal import subprocess from time import sleep from multiprocessing import Process def _iter_module_files(): """This iterates over all relevant Python files. It goes through all loaded files from modules, all files in folders of already loaded modules as well as all files...
app.py
# -*- coding: utf-8 -*- """The app module, containing the app factory function.""" import gevent.monkey gevent.monkey.patch_all() import logging import sys import os import threading from flask import Flask, render_template, current_app from flask_restful import Api from walle import commands from walle....
dns_spoofer.py
#!/usr/bin/python #------------------------------------------------------------------------------ # SOURCE: dns_spoofer.py # # AUTHOR: Alex Zielinski # # DATE: November 5, 2018 # # DESC: Proof of concept DNS spoofer using python and scapy library. #-----------------------------------------------------------------...
villas_node.py
import threading from villas.node.node import Node from villas.controller.components.manager import Manager from villas.controller.components.gateways.villas_node import VILLASnodeGateway class VILLASnodeManager(Manager): def __init__(self, **args): self.autostart = args.get('autostart', False) ...
global_handle.py
#!/usr/bin/python ''' (C) Copyright 2018-2019 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 applic...
multi_proxy_server.py
#!/usr/bin/env python3 import socket import time, sys from multiprocessing import Process #define address & buffer size # connect to proxy start HOST = "localhost" PORT = 8001 BUFFER_SIZE = 1024 def main(): extern_host = 'www.google.com' extern_port = 80 with socket.socket(socket.AF_INET, socket.SOCK_ST...
test_multiprocessing.py
import asyncio import copy import os import sys import multiprocessing import threading import time import pytest import loguru import platform from loguru import logger def do_something(i): logger.info("#{}", i) def set_logger(logger_): global logger logger = logger_ def subworker(logger_): logge...
server.py
############################################################################### # # The MIT License (MIT) # # Copyright (c) Vladimir Collak # # 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 w...
foscamdiscover.py
#!/usr/bin/env python # Discovers FOSCAM cameras on the local network # # By SukkoPera <software@sukkology.net> # October 2018 import struct import socket import threading import logging class DiscovererException (Exception): pass class Discoverer (object): BIND_IP = "" # All addresses PORT = 10000 DEFAULT_AUT...
test_cancel.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # test_cancel.py - unit test for query cancellation # # Copyright (C) 2010-2019 Jan Urbański <wulczer@wulczer.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...
test.py
import unittest import redis import uuid import threading from token_redis import * class TestCh02(unittest.TestCase): def setUp(self): import redis self.conn = redis.Redis(db=15) def tearDown(self): conn = self.conn to_del = ( conn.keys('login:*') + conn.keys('rece...
athenad.py
#!/usr/bin/env python3 import base64 import hashlib import io import json import os import sys import queue import random import select import socket import threading import time from collections import namedtuple from functools import partial from typing import Any import requests from jsonrpc import JSONRPCResponseM...
_sqlite_access.py
import sqlite3 import os import uuid import threading from datetime import datetime, timedelta from typing import List, Tuple, Optional from settings import settings class SQLiteAccess: def __init__(self): self.db_location = settings.FASTAPI_SIMPLE_SECURITY_DB_LOCATION # try: # self.db...
tello.py
import socket import threading import time import cv2 from easytello.stats import Stats from easytello.tello_control import TelloControl class Tello: def __init__(self, tello_ip: str='192.168.10.1', debug: bool=True): # 追加 self.lastframe = None self.controller: TelloCon...
recalbox_SafeShutdown.py
import RPi.GPIO as GPIO import os import time from multiprocessing import Process #initialize pins powerPin = 3 #pin 5 ledPin = 14 #TXD resetPin = 2 #pin 13 powerenPin = 4 #pin 5 #initialize GPIO settings def init(): GPIO.setmode(GPIO.BCM) GPIO.setup(powerPin, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO...
app.py
############################################################################# # Copyright (c) 2018, Voilà Contributors # # Copyright (c) 2018, QuantStack # # # # Distri...
thread_test1.py
""" # @Time : 2020/8/2 # @Author : Jimou Chen """ import time import threading def sing(): for i in range(3): print('singing ...') time.sleep(1) def dance(): for i in range(3): print('dancing ...') time.sleep(1) if __name__ == '__main__': # 创建线程 sing_thread = ...
mempool_accept.py
#!/usr/bin/env python3 # Copyright (c) 2018 The Bitcoin Unlimited developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import test_framework.loginit # This test exercises the mempool acceptance data path. from threading impo...
fixture.py
import os import socket import sys import types import uuid from multiprocessing import Process, Queue import pytest from _pytest.python import pytest_pyfunc_call as original_pytest_pyfunc_call from leapp.compat import raise_with_traceback from leapp.messaging.inprocess import InProcessMessaging from leapp.repository...
test_simpleconsumer.py
from contextlib import contextmanager import datetime as dt import json import mock import os import platform import pytest import time import threading import unittest2 from uuid import uuid4 try: import gevent except ImportError: gevent = None try: from pykafka.rdkafka import _rd_kafka # noqa RDKAF...
PhidgetBrushlessDCmotorDCC1100controller_ReubenPython2and3Class.py
# -*- coding: utf-8 -*- ''' Reuben Brewer, Ph.D. reuben.brewer@gmail.com www.reubotics.com Apache 2 License Software Revision D, 11/12/2021 Verified working on: Python 2.7, 3.8 for Windows 8.1, 10 64-bit and Raspberry Pi Buster (no Mac testing yet). ''' __author__ = 'reuben.brewer' from LowPassFilte...
face_streaming_server.py
import cv2 import time import threading from flask import Response, Flask import time import os import sys import socket import select # Flask 객체로 Image frame 전달 global video_frame video_frame = None # 다양한 브라우저에서 프레임들의 thread-safe 출력을 잠근다. global thread_lock thread_lock = threading.Lock() # Raspberry Camera에 접근하기 위한...
twisterlib.py
#!/usr/bin/env python3 # vim: set syntax=python ts=4 : # # Copyright (c) 2018 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import os import contextlib import string import mmap import math import sys import re import subprocess import select import shutil import shlex import signal import hashlib import thre...
event_loop_05_thread.py
# event_loop_05_thread.py # This version of the event loop shows how to use sockets and # I/O multiplexing to implement the to_thread() coroutine # that runs a specified callable in a separate thread, # yields the control and resumes when the result is ready. # # The event loop is NOT presented in the post. from col...
thread_tool.py
#!/usr/bin/python #coding=utf-8 # test thread in python """ @brief test thread in python @date 2018-02-08 """ import thread import threading import time def printNum(numbers, a_lock): if a_lock.acquire(): for i in range(numbers): print str(i)+"\n" a_lock.release() def print_num_in_mul...
potc_gui_v_2.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'potc_analysis_gui.ui' # # Created by: PyQt5 UI code generator 5.11.3 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets #import rospy import math import pandas as pd im...
plugin.py
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # -------------------------------------------------------------------------- from __future__ import absolute_import from __future__ import division from __future__ import print_functi...
Runner.py
import threading import ray from Ray_ACNet import ACNet import GroupLock from Primal2Env import Primal2Env from Primal2Observer import Primal2Observer from Map_Generator2 import maze_generator from Worker import Worker from parameters import * import os os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" class Runner(ob...
self.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.loginResult() ki = LINETCR.LINE() ki.login(qr=True) ki.loginResult() ki2 = LINETCR.LINE() ki2.login(qr=True) ki2.l...
main.py
import time import asyncio import threading import click import sys import os from raccoon_src.utils.coloring import COLOR, COLORED_COMBOS from raccoon_src.utils.exceptions import RaccoonException, HostHandlerException from raccoon_src.utils.request_handler import RequestHandler from raccoon_src.utils.logger import Sy...
controller.py
#!/usr/bin/env python from __future__ import print_function import logging LOG_FORMAT = '%(asctime)s %(levelname)s %(pathname)s:%(lineno)s: %(message)s' logging.basicConfig(format=LOG_FORMAT, level=logging.DEBUG) import os import signal import sys import six import threading import time import pprint import psutil i...
test_socket.py
import time import unittest import six if six.PY3: from unittest import mock else: import mock from engineio import exceptions from engineio import packet from engineio import payload from engineio import socket import pytest class TestSocket(unittest.TestCase): def setUp(self): self.bg_tasks =...
gameClientNoGUI.py
# -*- coding: utf-8 -*- # 这是没有GUI欢迎界面的游戏客户端, 不需安装EasyGui即可运行 import pgzrun import random from pgzero.actor import Actor from pgzero.rect import Rect, ZRect from pgzero.screen import Screen from backstageNoGUI import flag, game, waiting, ide, clicktime, tcpCliSock, account, target, connect, Game, Command, syncT...
moteDetector.py
import bluetooth import select import time import threading from moteCache import MoteCache class SimpleDiscoverer(bluetooth.DeviceDiscoverer): def __init__(self): bluetooth.DeviceDiscoverer.__init__(self) def pre_inquiry(self): self.done = False def device_discovered...
eureka_client.py
# -*- coding: utf-8 -*- import atexit import json import os import re import socket import time import random import inspect import xml.etree.ElementTree as ElementTree from threading import Timer from threading import RLock from threading import Thread try: from urllib.parse import urlparse except ImportError: ...
__init__.py
# Copyright 2017 Mycroft AI 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 writin...
_exit_scenarios.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...
stats_store.py
#!/usr/bin/env python """Storage implementation for gathered statistics. Statistics collected by StatsCollector (see lib/stats.py) is stored in AFF4 space. Statistics data for different parts of the system is separated by process ids. For example, for the frontend, process id may be "frontend", for worker - "worker", ...
test_MMTransE_lan_mapping_120k_fk.py
import sys import os sys.path.append(os.path.join(os.path.dirname(__file__), '../../src/MMTransE')) from MMTransE import MMTransE import time import multiprocessing from multiprocessing import Process, Value, Lock, Manager, Array import numpy as np from numpy import linalg as LA fmap = os.path.join(os.path...
picoss_func.py
import sys sys.path.append('..') import gc import numpy as np import obspy import math import multiprocessing from obspy import UTCDateTime import os # Graphical Packages from PyQt4 import QtGui, QtCore from matplotlib.widgets import RectangleSelector from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT ...
motorbackend.py
from serial import Serial from threading import Thread, Lock class DaisyDriver(Serial): def __init__(self, connected = True): # check for connection bool to allow for dummy DaisyDriver object # if not connected if connected: # initialise DaisyDriver serial object (hard code serial address for now) super...
__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 **sends** keyboard events. ...
crashreporter.py
__author__ = 'calvin' import ConfigParser import datetime import glob import json import logging import os import re import shutil import smtplib import sys import time from email import encoders from email.mime.base import MIMEBase from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText fr...
publisher_server.py
import json import sys import traceback from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from SocketServer import ThreadingMixIn import threading from Queue import Queue from oslo_config import cfg from ceilometer import service from ceilometer_fiprom.fiprom_storage import PrometheusStorage from ceilom...
main.py
# Joey Alexander # Built by Gautam Mittal (2017) # Real-time chord detection and improvisation software that uses Fast Fourier Transforms, DSP, and machine learning import sys sys.path.append('util') from PyQt4 import QtGui, QtCore from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from m...
update_stock_trade.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import multiprocessing import os import sys import time import traceback from webapp.models.req_error_log import ReqErrorLog sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) from webapp import app, db, config_app from webapp.services import db_service as db...
website.py
from threading import Thread import webbrowser, http.server, socketserver import time # 网站绑定端口号 port_number = 8080 server = None def startServer(port): Handler = http.server.SimpleHTTPRequestHandler global server server = socketserver.TCPServer(("", port), Handler) print("Start server at port", port)...
youtube_client.py
#!/usr/bin/env python3 import argparse from tkinter import Tk from tkinter import X as FILLX from tkinter import BOTH as FILLBOTH from tkinter.ttk import Treeview, Progressbar, Style, Frame, Label, Button import threading import requests from bs4 import BeautifulSoup, SoupStrainer import json import datetime impor...
plot.py
import numpy as np import os import pinocchio as pin from mlp.utils.util import discretizeCurve, discretizeSE3CurveTranslation, discretizeDerivateCurve import matplotlib matplotlib.use("Qt4agg") import matplotlib.pyplot as plt from multiprocessing import Process from mlp.utils.requirements import Requirements pin.switc...
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 Project Contr...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
start.py
#!/usr/bin/python3 import os import glob import multiprocessing import logging as log import sys from podop import run_server from socrate import system, conf log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING")) def start_podop(): os.setuid(8) url = "http://" + os.environ["ADMI...
helpers.py
from LSP.plugin.core.typing import Any, Callable, List, Optional, Tuple import re import sublime import subprocess import threading StringCallback = Callable[[str], None] SemanticVersion = Tuple[int, int, int] def run_command_sync(args: List[str], cwd: Optional[str] = None) -> Tuple[str, Optional[str]]: """ ...
connection.py
# Copyright (c) 2015 Red Hat, 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 ...
learn1Huella.py
#!/usr/bin/python3 import io import csv import json import warnings import pickle import operator import time import logging import math import functools import numpy from sklearn.preprocessing import MinMaxScaler from threading import Thread from random import shuffle from sklearn.neural_network import MLPClassifier ...
jupyter_utils.py
# Copyright 2020 The Kale 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 ...
video_ffpyplayer.py
''' FFmpeg based video abstraction ============================== To use, you need to install ffpyplayer and have a compiled ffmpeg shared library. https://github.com/matham/ffpyplayer The docs there describe how to set this up. But briefly, first you need to compile ffmpeg using the shared flags while disabling...