source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
main.py | import client
import get_plant
import time
import RPi.GPIO as GPIO
import picamera
import math
import numpy as np
import argparse
import cv2
import json
import MPU9250
# GPIO setup
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)
GPIO.setup(25, GPIO.OUT)
servo=GPIO.PWM(17, 100)
# Connect to the server and take possess... |
dev_test_dex_subscribe.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: dev_test_dex_subscribe.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api
# Documentation: https://lucit-systems-and-development.github.io/unicorn-binance-websocket-api
... |
mysql.py | import queue
import traceback
from threading import Thread
import pymysql
from common import util
class IDEBenchDriver:
def init(self, options, schema, driver_arg):
self.time_of_latest_request = 0
self.isRunning = False
self.requests = queue.LifoQueue()
# mysql properties
... |
dynamic_batching_test.py | # Copyright 2021 Cortex Labs, 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 wri... |
api_image_test.py | import contextlib
import json
import shutil
import socket
import tarfile
import tempfile
import threading
import pytest
import six
from six.moves import BaseHTTPServer
from six.moves import socketserver
import docker
from ..helpers import requires_api_version, requires_experimental
from .base import BaseAPIIntegrat... |
mininet_multicast_dynamic.py | #!/usr/bin/env python
from groupflow_shared import *
from mininet.net import *
from mininet.node import OVSSwitch, UserSwitch
from mininet.link import TCLink
from mininet.log import setLogLevel
from mininet.cli import CLI
from mininet.node import Node, RemoteController
from scipy.stats import truncnorm
from numpy.rando... |
platform_utils.py | # -*- coding:utf-8 -*-
#
# Copyright (C) 2016 The Android Open Source Project
#
# 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 re... |
posix.py | from __future__ import unicode_literals
import fcntl
import os
import signal
import threading
import time
from prompt_toolkit.terminal.vt100_input import InputStream
from prompt_toolkit.utils import DummyContext, in_main_thread
from prompt_toolkit.input import Input
from .base import EventLoop, INPUT_TIMEOUT
from .cal... |
camera.py | #!/usr/bin/python
import os, io, threading, picamera
from picamera import PiCamera
class Camera(object):
running = True
current_frame = None
thread = None
camera = None
def __init__(self, resolution="VGA",quality=50,framerate=60):
self.resolution = resolution
self.quality = quality... |
test_external_step.py | import os
import tempfile
import time
import uuid
from threading import Thread
import pytest
from dagster import (
Field,
ModeDefinition,
RetryRequested,
String,
execute_pipeline,
execute_pipeline_iterator,
pipeline,
reconstructable,
resource,
solid,
)
from dagster.core.definiti... |
simple_net_abstract.py | # -*- coding: utf-8 -*-
""".. moduleauthor:: Artur Lissin"""
import abc
import atexit
import math
import multiprocessing
import queue
import time
from copy import deepcopy
import pickle as rick
from dataclasses import dataclass, field
from datetime import datetime
from enum import Enum
from functools import reduce
fro... |
__init__.py | # Copyright 2018 Criteo
#
# 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, softw... |
runserver.py | from __future__ import print_function
import atexit
import os
import psutil
import subprocess
import sys
import traceback
from signal import SIGTERM
from threading import Thread
from django.contrib.staticfiles.management.commands.runserver import Command as RunserverCommand
from django.core.management.base import C... |
threading_simple.py | #!/usr/bin/env python
# encoding: UTF-8
import threading
def worker():
print'Worker'
return
threads=[]
for i in range(5):
t=threading.Thread(target=worker)
threads.append(t)
t.start()
|
permission_controllers.py | import random
from builtins import callable, getattr
from multiprocessing import Manager, Pool, Process
class PraxoPermission:
def _permission_controller_forsure(self, user_obj, **kwargs):
l = []
print(kwargs)
for key, value in kwargs.items():
if callable(getattr(user_obj, 'has... |
Parallel_MergeSort.py | #!/usr/bin/env python3
""" Merge Sort Algorithm for Sort an array of random integers with parallel and sequential apporach is used."""
import random
import math
import multiprocessing as mp
""" helper method to merge two sorted subarrays
array[l..m] and array[m+1..r] into array """
def merge(array, left,... |
assemble_features.py | """
Script that runs several docker containers which in turn runs an analysis on
a git repository.
"""
__author__ = "Oscar Svensson"
__copyright__ = "Copyright (c) 2018 Axis Communications AB"
__license__ = "MIT"
import os
import sys
import shutil
import time
from argparse import ArgumentParser
from distutils.dir_uti... |
lcm_api.py | import json
import uuid
import threading
import tornado.web
from app.service import token_service
from app.domain.task import Task
from app.domain.deployment import Deployment
from app.service import umm_client
from app.service import lcm_service
from app.utils import mytime
class LcmApi(tornado.web.RequestHandler):
... |
ddpg_trainer.py | from __future__ import absolute_import
from builtins import object
import logging
import numpy as np
import six.moves.queue as queue
import threading
from relaax.common import profiling
from relaax.server.common import session
from relaax.common.algorithms.lib import episode
from relaax.common.algorithms.lib import o... |
open-in-vscode-python3.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import locale, gettext, urllib.request, urllib.parse, urllib.error, os, subprocess
from gi.repository import Nemo, GObject
from multiprocessing import Process
EXTENSION_NAME = "nemo-open-in-vscode"
LOCALE_PATH = "/usr/share/locale/"
locale.setlocale(locale.LC_ALL, '')
gette... |
test_lock.py | import os
import subprocess
import sys
import threading
import traceback
from modelkit.assets.remote import StorageProvider
from tests import TEST_DIR
def _start_wait_process(lock_path, duration_s):
script_path = os.path.join(TEST_DIR, "assets", "resources", "lock.py")
result = None
def run():
n... |
cluster_test.py | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
server.py | from BaseHTTPServer import HTTPServer
from httpHandler import HttpHandler
from multiprocessing import Process
import asyncore
import socketServer
def __create_http():
http = HTTPServer(('0.0.0.0', 9000), HttpHandler)
print 'HTTP server started...'
http.serve_forever()
def __create_sock():
socketServer.SocketServe... |
messagethrottler.py | import time
import threading
import Queue
class MessageThrottler:
def __init__(self, transmitter, max_pages = 3, interval = 15):
self.max_pages = max_pages
self.interval = interval
self.transmitter = transmitter
self._setup_thread()
def _setup_thread(self):
self.messa... |
threadsafety.py | from __future__ import division
"""The Python interpreter may switch between threads inbetween bytecode
execution. Bytecode execution in fastcache may occur during:
(1) Calls to make_key which will call the __hash__ methods of the args and
(2) `PyDict_Get(Set)Item` calls rely on Python comparisons (i.e, __eq__)
t... |
deal_new.py | import numpy as np
import os
import threading
import goal_address
np.random.seed(1337)
path='1.txt'
db = goal_address.connectdb()
def file_name(file_dir):
for root, dirs, files in os.walk(file_dir):
return files
def load(path):
f = open("./txt/"+path)
f2=open("./new_content/"+path,'w')... |
stockbarcollector.py | # **************************************************************************** #
# #
# ::: :::::::: #
# stockBarCollector.py :+: :+: :+: ... |
ui.py | from sqlite3 import IntegrityError
from tkinter import *
from tkinter import messagebox, filedialog
from tkinter import font
from tkinter.ttk import *
from threading import Thread
from winlogtimeline import util, collector
from winlogtimeline.util.logs import Record
from .new_project import NewProject
from .tag_settin... |
blockchain_processor.py | #!/usr/bin/env python
# Copyright(C) 2011-2016 Thomas Voegtlin
#
# 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, ... |
main.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import time
import json
import telegram.ext
import telegram
import sys
import datetime
import os
import logging
import threading
import six
if six.PY2:
reload(sys)
sys.setdefaultencoding('utf8')
Version_Code = 'v1.0.0'
logging.basicConfig(level=l... |
spinner.py | # Copyright (c) 2018, Vanessa Sochat All rights reserved.
# See the LICENSE in the main repository at:
# https://www.github.com/openschemas/openschemas-python
import os
import sys
import sys
import time
import threading
from random import choice
class Spinner:
spinning = False
delay = 0.1
@staticmeth... |
nix_attack.py | #!/usr/bin/env python
#**************************************************************************#
# Filename: py_rev_shel.py (Created: 2016-08-18) #
# (Updated: 2016-10-02) #
# Info: ... |
test_collection.py | import pdb
import pytest
import logging
import itertools
from time import sleep
from multiprocessing import Process
from milvus import IndexType, MetricType
from utils import *
dim = 128
drop_collection_interval_time = 3
index_file_size = 10
vectors = gen_vectors(100, dim)
class TestCollection:
"""
********... |
gpu_usage.py | ################################################################################
# Copyright (c) 2021 ContinualAI. #
# Copyrights licensed under the MIT License. #
# See the accompanying LICENSE file for terms. ... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2018 The Cruro Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test bitcoind shutdown."""
from test_framework.test_framework import BitcoinTestFramework
from test_framework... |
websocket_client.py | # cbpro/WebsocketClient.py
# original author: Daniel Paquin
# mongo "support" added by Drew Rice
#
#
# Template object to receive messages from the Coinbase Websocket Feed
from __future__ import print_function
import json
import base64
import hmac
import hashlib
import time
from threading import Thread
from websocket ... |
greatfet_uart.py | #!/usr/bin/env python3
#
# This file is part of GreatFET.
#
from __future__ import print_function, absolute_import
import os
import sys
import time
import queue
import select
import threading
import greatfet
from greatfet import GreatFET
from greatfet.utils import from_eng_notation, GreatFETArgumentParser
from grea... |
halo.py | # -*- coding: utf-8 -*-
# pylint: disable=unsubscriptable-object
"""Beautiful terminal spinners in Python.
"""
from __future__ import absolute_import, unicode_literals
import atexit
import functools
import sys
import threading
import time
import re
import halo.cursor as cursor
from log_symbols.symbols import LogSy... |
rpc_server.py | #!/usr/bin/env python
import pika
import json
import threading
import functools
from config import LOG_PREFIX, CLASSIFICATION, RECOGNITION, \
MULTI_RECOGNITION, START_MODEL_TRAINING_QUEUE, HOST, MODELS_DIR, \
EX_MODEL, KEY_MODEL_TRAINING_SUCCEED, KEY_MODEL_TRAINING_FAILED, \
... |
test_token_refresh.py | import os
import unittest
from time import sleep, time
from threading import Thread
from datetime import datetime, timedelta
from lusid.utilities import ApiConfigurationLoader
from lusid.utilities.proxy_config import ProxyConfig
from lusid.utilities import RefreshingToken
from parameterized import parameterized
from ... |
stock_chart_canvas.py | from typing import Iterable, Tuple
from ipycanvas import Canvas
from datetime import date, datetime, time, timedelta, timezone
from ipycanvas.canvas import hold_canvas
from ipycanvas import Canvas
from threading import Event, Thread
from traitlets.traitlets import Enum
def draw_ticker(ticker, canvas):
pass
class... |
utils.py | from __future__ import print_function
import sys
import time
import threading
import platform
import subprocess
import os
from fibre.utils import Event
from odrive.enums import errors
try:
if platform.system() == 'Windows':
import win32console
import colorama
colorama.init()
except ImportE... |
MiscIndexerServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import os
import random as _random
import sys
import traceback
from getopt import getopt, GetoptError
from multiprocessing import Process
from os import environ
from wsgiref.simple_server import make_server
import requests as _requests
from json... |
export.py | #!/usr/bin/env python3.6
"""Module for the export of observations."""
__author__ = 'Philipp Engel'
__copyright__ = 'Copyright (c) 2017 Hochschule Neubrandenburg'
__license__ = 'BSD-2-Clause'
import copy
import threading
import time
from enum import Enum
from pathlib import Path
from typing import Any, Dict, Union
... |
CO2Meter.py | """
Module for reading out CO2Meter USB devices
via a hidraw device under Linux
"""
import sys
import fcntl
import threading
import weakref
CO2METER_CO2 = 0x50
CO2METER_TEMP = 0x42
CO2METER_HUM = 0x41
HIDIOCSFEATURE_9 = 0xC0094806
def _co2_worker(weak_self):
"""
Worker thread that constantly reads from the u... |
azurecli.py | from iotedgedev.connectionstring import IoTHubConnectionString
import json
import os
import signal
import subprocess
import sys
from io import StringIO
from threading import Thread, Timer
from azure.cli.core import get_default_cli
from fstrings import f
from queue import Empty, Queue
from . import telemetry
output_i... |
pjit_test.py | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
test_threading_2.py | # testing gevent's Event, Lock, RLock, Semaphore, BoundedSemaphore with standard test_threading
from __future__ import with_statement
setup_ = '''from gevent import monkey; monkey.patch_all()
from gevent.event import Event
from gevent.lock import RLock, Semaphore, BoundedSemaphore
from gevent.thread import allocate_lo... |
fn.py | import warnings
from typing import List
import os
import re
import random
import time
import multiprocessing as mp
import psutil
import numpy as np
import torch
from prettytable import PrettyTable
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
def seed_everything(seed=1000):
""... |
mlp_es.py | """
Evolutionary strategies implementation for training a neural network
"""
import time
import threading
import math
import tensorflow as tf
import tensorflow.contrib.slim as slim
from tensorflow.examples.tutorials.mnist import input_data
import numpy as np
INPUT_DIMENSIONS = [28, 28, 1]
# Hyper params
BATCH_SIZE = 2... |
subproc_vec_env.py | import numpy as np
from multiprocessing import Process, Pipe
from baselines.common.vec_env import VecEnv, CloudpickleWrapper
def worker(remote, parent_remote, env_fn_wrapper):
parent_remote.close()
env = env_fn_wrapper.x()
while True:
cmd, data = remote.recv()
if cmd == 'step':
... |
threads.py | from transitions.extensions import LockedMachine as Machine
from threading import Thread
import sys
import time
states_A = ['A', 'B', 'C']
machine = Machine(states=states_A, initial='A')
states_B = ['M','N','O']
machineB = Machine(states = states_B, initial = 'M')
def func_states_A():
while(1):
ctrl = i... |
main.py | from threading import Thread, Event
from queue import Queue
from tkinter import Tk, ttk
from time import sleep as wait
from loggingFramework import Logger
import requests
import json
import sys
logger = Logger()
def handle_exception(etype, value, traceback):
logger.logException(value)
quit()
sys.exc... |
x.py | import argparse
import asyncio
import importlib.util
import logging
from multiprocessing import get_context
import os
import signal
import sys
import traceback
from typing import Iterable, List, Optional, Text, Tuple
import aiohttp
import ruamel.yaml as yaml
from rasa.cli import SubParsersAction
from rasa.cli.argumen... |
shots_segmentation_client_RPi.py | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 5 12:03:29 2018
@author: imlab
"""
print ('Processing...')
import cv2
import threading
from threading import Thread
from yolo_main import tinu
import time
import os
s_time = time.time()
def video0():
print ('Processing Video')
#capture = cv2.VideoCapture('15... |
PyGLM vs NumPy.py | from threading import Thread
import time, math
glm_counter = 0
numpy_counter = 0
glm_time = 0
numpy_time = 0
test_duration = 1
display_update_delay = 1 / 10
results = []
def measure_function_glm(func, *args, **kw):
global glm_counter
glm_counter = 0
start = time.time()
last_print = 0
while Tr... |
main.py | import pandas as pd
import akshare as ak
import yfinance as yf
import psycopg2
from sqlalchemy import create_engine
from numpy import (float64, nan)
from abc import (abstractmethod)
import pathlib
import os
import time
from EmQuantAPI import *
import traceback
import datetime
import enum
import logging as log
import sy... |
manager.py | from __future__ import absolute_import, division, print_function, \
with_statement
import errno
import traceback
import socket
import logging
import json
import collections
from shadowsocks import common, eventloop, tcprelay, udprelay, asyncdns, shell
BUF_SIZE = 1506
STAT_SEND_LIMIT = 100
class Manager(object... |
omsagent.py | #!/usr/bin/env python
#
# OmsAgentForLinux Extension
#
# Copyright 2015 Microsoft 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.... |
base.py | import base64
import hashlib
import io
import json
import os
import threading
import traceback
import socket
import sys
from abc import ABCMeta, abstractmethod
from http.client import HTTPConnection
from typing import Any, Callable, ClassVar, Optional, Tuple, Type, TYPE_CHECKING
from urllib.parse import urljoin, urlspl... |
foggycam.py | """FoggyCam captures Nest camera images."""
from urllib.request import urlopen
import urllib
import json
from http.cookiejar import CookieJar
import os
import traceback
import uuid
import threading
import time
import shutil
from datetime import datetime
from subprocess import call
class FoggyCam(object):
"""Fogg... |
globals.py | #!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2020 FABRIC Testbed
#
# 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 ... |
dlis.py | """
Pyhton DLIS file reader
Adriano Paulo - adrianopaulo@gmail.com
July 2016
PREFACE:
American Petroleum Institute (API) Standard RP66 Version 1 (RP66 V1),
published in May 1991, specified a format for digital well log data,
called Digital Log Interchange Stand... |
wifi_origin.py | """
Core OpenBCI object for handling connections and samples from the WiFi Shield
Note that the LIB will take care on its own to print incoming ASCII messages if any (FIXME, BTW).
EXAMPLE USE:
def handle_sample(sample):
print(sample.channels_data)
wifi = OpenBCIWifi()
wifi.start(handle_sample)
TODO: Cyton/Gangli... |
bgapi.py | from __future__ import print_function
# for Python 2/3 compatibility
try:
import queue
except ImportError:
import Queue as queue
import logging
import serial
import time
import threading
from binascii import hexlify, unhexlify
from uuid import UUID
from enum import Enum
from collections import defaultdict
f... |
local_visualizer.py | # -*- coding: utf-8 -*-
"""Simple api to visualize the plots in a script.
Motivation
==========
* When moving from an IPython notebook to a script, we lose the diagnostics
of visualizing pandas as tables and matplotlib plots.
* :class:`LocalViz` starts a local http server and creates a html file to
which panda... |
main.py | import sys
from threading import Thread
from time import sleep
import requests
import webview
from kanmail.license import validate_or_remove_license
from kanmail.log import logger
from kanmail.server.app import boot, server
from kanmail.server.mail.folder_cache import (
remove_stale_folders,
remove_stale_hea... |
util.py | # Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# 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 t... |
plot.py | import copy
import json
import threading
import webbrowser
import numpy as np
import pandas as pd
from enum import IntEnum
from pathlib import Path
from http.server import HTTPServer, SimpleHTTPRequestHandler
from IPython.display import IFrame
from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket
from sci... |
variantCallingLib.py | #!/usr/bin/env python
"""Library for calling variants
"""
from __future__ import print_function
import sys
import os
import glob
import pandas as pd
import numpy as np
from random import shuffle
from signalAlignLib import SignalAlignment
from alignmentAnalysisLib import CallMethylation
from multiprocessing import Proce... |
event_based_asynchronous.py | """ Referred to concurrent.futures.thread and concurrent.futures._base """
import itertools
import queue
import time
import threading
from typing import Iterable, Union, Callable, Any
def lprint(*args, **kwargs):
if not hasattr(lprint, 'print_lock'):
lprint.print_lock = threading.Lock()
with lprint.... |
data_infer.py | import numpy as np
import glob
import os
import uproot as ur
import time
from multiprocessing import Process, Queue, set_start_method
import compress_pickle as pickle
from scipy.stats import circmean
import random
class MPGraphDataGenerator:
"""DataGenerator class for extracting and formating data from list of roo... |
SetpointPublisher.py | import enum
import logging
import time
import threading
import uavcan
class ControlTopic(enum.Enum):
voltage = "voltage"
torque = "torque"
velocity = "velocity"
position = "position"
def __str__(self):
return self.value
def __call__(self, node_id, value):
return {
... |
network_layer.py | import time
import threading
from threading import Thread
import datetime
import json
import traceback
import socket
#import networking
import tcp
import udp
import uuid
from connection_state import ConnectionState
def is_published_function(application, function_name):
# does the function exist on this application?... |
wrapper.py | #!/usr/bin/env python
import subprocess
import sys
import os
import time
import inspect
import json
import socket
import threading
import SocketServer
import traceback
import hashlib
os.chdir('.' or sys.path[0])
global current_dir
folders = sys.argv[0].split(os.sep)
proper_path = os.sep.join(folders[0:-1])
current_dir... |
remise.py | #!/usr/bin/python3
import json;
import subprocess;
# import dummy_threading as threading;
import threading;
import argparse;
parser = argparse.ArgumentParser(description="git repo fetcher");
parser.add_argument("--destination", help='base dir destination');
parser.add_argument("--branch", help="branch to be checked o... |
binlogSenderManager.py | # Copyright (c) 2020-present ly.com, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
jobStoreTest.py | # Copyright (C) 2015-2016 Regents of the University of California
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
models.py | """
A2C, IA2C, MA2C models
@author: Tianshu Chu
"""
import os
from agents.utils import *
from agents.policies import *
import logging
import multiprocessing as mp
import numpy as np
import tensorflow as tf
class A2C:
def __init__(self, n_s, n_a, total_step, model_config, seed=0, n_f=None):
# load paramet... |
player.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
对mplayer及其他播放器(TODO)的控制
player = MPlayer()
方法:
player.start(url)
player.pause()
player.quit()
player.loop()
player.set_volume(50)
player.time_pos
player.is_alive
queue自定义get_song方法, 从中取出url, 进行播放(暂时, 以后可以抽象)
player.start_queue(que... |
utils.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import os
import time
import socket
import unittest
import smtplib
import json
from threading import Thread
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
from email... |
telem_display.py | import sys
import functools
import signal
import select
import socket
import numpy as np
import pickle
import matplotlib.pyplot as plt
import time
import datetime
from multiprocessing import Process, Queue
sys.path.append('../dhmsw/')
import interface
import telemetry_iface_ag
import struct
PLOT = True
headerStruct = ... |
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... |
test_locking.py | #emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
#ex: set sts=4 ts=4 sw=4 noet:
"""
LICENSE: MIT
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 ... |
text_client.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... |
__init__.py | """
The ``python_function`` model flavor serves as a default model interface for MLflow Python models.
Any MLflow Python model is expected to be loadable as a ``python_function`` model.
In addition, the ``mlflow.pyfunc`` module defines a generic :ref:`filesystem format
<pyfunc-filesystem-format>` for Python models and... |
tarkov_examine.py | import argparse
import logging
import threading
from collections import namedtuple
from time import sleep
from typing import List
import numpy as np
import cv2 as cv
from mss import mss
import pyautogui
parser = argparse.ArgumentParser()
parser.add_argument('--debug', action='store_true')
parser.add_argument('--no-w... |
test_callbacks.py | # -*- coding: utf-8 -*-
import pytest
from pybind11_tests import callbacks as m
from threading import Thread
import time
import env # NOQA: F401
def test_callbacks():
from functools import partial
def func1():
return "func1"
def func2(a, b, c, d):
return "func2", a, b, c, d
def ... |
select.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import time
import threading
import shutil
import itertools
import wx
import cw
import cw.binary.cwfile
import cw.binary.environment
import cw.binary.party
import cw.binary.adventurer
import message
import charainfo
#--------------------------... |
logger.py | import logging
import os
from multiprocessing import Queue, Process
from dataclasses import dataclass
import time
from abc import ABC, abstractmethod
from enum import Enum
import sys
import traceback
from ml_gym.error_handling.exception import SingletonAlreadyInstantiatedError
class LogLevel(Enum):
CRITICAL = 50
... |
pyto_ui.py | """
UI for scripts
The ``pyto_ui`` module contains classes for building and presenting a native UI, in app or in the Today Widget.
This library's API is very similar to UIKit.
This library may have a lot of similarities with ``UIKit``, but subclassing isn't supported very well. Instead of overriding methods, you will... |
customer.py | '''
Customer Service. Provides Customer API as described on def index()
2018 Ayhan AVCI.
mailto: ayhanavci@gmail.com
https://lain.run
https://github.com/ayhanavci/
'''
from flask import Flask
from flask import request
from flask import json
from flask import jsonify
import redis
import requests
import os
import pika... |
cam.py | #!/usr/bin/python
# Version: 2.1 (see ChangeLog.md for a list of changes)
# -------------------------------------------------------------------------------
# Header from original version:
# Point-and-shoot camera for Raspberry Pi w/camera and Adafruit PiTFT.
# This must run as root (sudo python cam.py) due to frame... |
slibtk.py | """
standard library tool-kit
this module contains commonly used functions to process and manipulate standard library objects
"""
import csv
import functools
import itertools
import json
import logging
import os
import pickle
import random
import re
import sys
import time
from collections import namedtuple, defaultdict... |
data_helper.py | import copy
import socket
from multiprocessing.process import BaseProcess as Process
from multiprocessing.queues import Queue
import random
import time
from random import Random
import uuid
from TestInput import TestInputServer
from TestInput import TestInputSingleton
import logger
import zlib
import crc32
import hashl... |
test_wal_acceptor.py | import pytest
import random
import time
from contextlib import closing
from multiprocessing import Process, Value
from fixtures.zenith_fixtures import WalAcceptorFactory, ZenithPageserver, PostgresFactory
pytest_plugins = ("fixtures.zenith_fixtures")
# basic test, write something in setup with wal acceptors, ensure... |
command_handlers.py | #!/usr/bin/env python3
#
# Copyright (c) 2020, The OpenThread Authors.
# 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. Redistributions of source code must retain the above copyright
# ... |
mqtt_client.py | #!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
MQTT client utility: Tries to hide Paho client details to ease MQTT usage.
Reconnects to the MQTT server automatically.
This module depends on the paho-mqtt package (ex-mosquitto), provided by the
Eclipse Foundation: see http://www.eclipse.org/paho
:author: Th... |
tests_ldacgsmulti.py | from __future__ import print_function
from builtins import zip
from builtins import range
from builtins import object
import unittest2 as unittest
import numpy as np
from vsm.corpus import Corpus
from vsm.corpus.util.corpusbuilders import random_corpus
from vsm.model.ldacgsseq import *
from vsm.model.ldacgsmulti imp... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import electrum_smart as electrum
from electrum_smart.bitcoin import TYPE_ADDRESS
from electrum_smart import WalletStorage, Wallet
from electrum_smart_gui.kivy.i18n import _
from electrum_smart.paym... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.