source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
threads.py | import threading
def writer(x, event_for_wait, event_for_set):
for i in range(5):
event_for_wait.wait() # wait for event
event_for_wait.clear() # clean event for future
print(x)
event_for_set.set() # set event for neighbor thread
# События управления потоками
e1 = threadi... |
main.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name:main.py
Author:Johnhay
date:20.9.26
-------------------------------------------------
Change Activity:20.9.26:
-------------------------------------------------
"""
import urllib
import urllib.request
f... |
EIS_Simulator_final.py | from tkinter import *
from PIL import Image, ImageTk
from functools import partial
#import modules for opening and formatting windows and image processing
# pathway to image folder (note:change to your device path, if on Windows change backslashes to forward)
img_folder_path="F:/Python images for EIS"
img... |
github-activity.py | #!/usr/bin/python3
import argparse
import curses
import functools
import json
import os
import subprocess
import sys
import threading
import time
from curses import wrapper
from dataclasses import dataclass
from datetime import datetime
from select import select
from typing import List
from github import Github
DEFA... |
motor.py | # Step Motor driver
# We reference code from "2D plotter"
# Author: Lanyue Fang:(Soft: initialization, axis selection. Hard: physical connection)
# Jingkai Zhang:(Soft: multiprocess. Hard: Cut wires and choose GPIO pins)
# Date: 2021.11
import RPi.GPIO as GPIO
import time
import threading
from init import rea... |
preallocator.py | #
# preallocator.py - maintains a pool of active virtual machines
#
from builtins import object
from builtins import range
import threading, logging, time, copy
from tangoObjects import TangoDictionary, TangoQueue, TangoIntValue
from config import Config
#
# Preallocator - This class maintains a pool of active VMs fo... |
liveappmain.py | """
HotReloader
-----------
Uses kaki module for Hot Reload (limited to some uses cases).
Before using, install kaki by `pip install kaki`
"""
import os
from threading import Thread
import socket
from kaki.app import App as HotReloaderApp # NOQA: E402
from kivy.factory import Factory
from kivy.logger import LOG_LEVE... |
ultrasonic_server.py | import threading
import SocketServer
# import cv2
import numpy as np
import math
# distance data measured by ultrasonic sensor
sensor_data = " "
class SensorDataHandler(SocketServer.BaseRequestHandler):
data = " "
def handle(self):
global sensor_data
try:
while self.data:
... |
models.py | from peewee import *
from datetime import datetime
from Utils.IDGenerator import gen_token
from Utils import Salting, JWT, db
from threading import Thread
class BaseModel(Model):
class Meta:
database = db
class User(BaseModel):
uid = TextField(primary_key=True)
date_created = DateTimeField(def... |
run_samplers.py | #!/usr/bin/env python
import os
import copy
import atexit
import argparse
from pprint import pprint
import multiprocessing as mp
from redis import StrictRedis
import torch
from catalyst.dl.scripts.utils import prepare_modules
from catalyst.contrib.registry import Registry
from catalyst.utils.config import parse_args_... |
aem_hacker.py | #! /usr/bin/env python
import concurrent.futures
import itertools
import json
import datetime
import traceback
import sys
import argparse
import base64
import time
from collections import namedtuple
from http.server import BaseHTTPRequestHandler, HTTPServer
from random import choice, randint
from string import ascii_l... |
conftest.py | # stdlib
import logging
from multiprocessing import Process
import socket
from time import time
from typing import Any as TypeAny
from typing import Callable as TypeCallable
from typing import Dict as TypeDict
from typing import Generator
from typing import List as TypeList
# third party
import _pytest
import pytest
... |
server.py | # Copyright 2018 Braxton Mckee
#
# 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 t... |
dhcp_client.py | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... |
download_manager.py | # -*- coding: utf-8 -*-
import os
import time
from queue import Queue, Empty
from threading import Thread
from urllib.parse import urlparse
from tqdm import tqdm
from multidl.constants import DownloadState, STATE_TRANSITIONS
from multidl.downloaders import SCHEMES
from multidl.exceptions import TransitionError
cla... |
__init__.py | """
Plugin for Pyramid apps to submit errors to Rollbar
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import copy
import functools
import inspect
import json
import logging
import os
import socket
import sys
import threading
import time
import traceback
import types
import uuid
imp... |
executar.py | from threading import Thread
from os import system
def executar_rp(exe: str):
'''Função que executa um aplicativo externo
Parameters:
exe (str): String com aplicativo e parâmetros
'''
try:
system(exe)
except Exception as er:
print('executar_rp:')
print(er)
def outraRota(funcao, *args: tuple):
'''Função... |
lfadsqueue.py | # Goals
# -----
#
# What we want is to launch and monitor multiple shell scripts simultaneously.
# We have a list of tasks. Each task has a certain amount of memory that it needs in GPU memory.
#
# Launch tensorboard with all runs queued.
#
# At the start, we loop through the queue and determine if the next task can ru... |
data_plane.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
test_utils.py | # Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... |
scene.py | import _thread as thread
import ast
import io
import json
import os
import sqlite3
import sys
import time
import warnings
from multiprocessing import Process
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "."))
from shared import SharedOptions
if SharedOptions.PROFILE == "win... |
test_dht_crypto.py | import dataclasses
import multiprocessing as mp
import pickle
import pytest
import hivemind
from hivemind.dht.crypto import RSASignatureValidator
from hivemind.dht.node import DHTNode
from hivemind.dht.validation import DHTRecord
from hivemind.utils.crypto import RSAPrivateKey
from hivemind.utils.timed_storage import... |
app.py | # -*- coding: utf-8 -*-
#!/usr/bin/env python
"""
Main training workflow
"""
from __future__ import division
import os
import sys
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.abspath(os.path.join(PROJECT_ROOT, "..")))
import argparse
import glob
import os
import random
impo... |
core_test.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
multi_scene.py | from ana import ANASearch
from astar import AstarSearch
import numpy as np
from playground_generator import PybulletPlayground
import random
import multiprocessing as mp
def search(i):
path_len = 0
while True:
seed = random.randint(1,100000)
random.seed(seed)
print('[Start: Seed={}]'.f... |
gdax.py | # Import Built-Ins
import logging
import json
import threading
import time
# Import Third-Party
from websocket import create_connection, WebSocketTimeoutException
import requests
# Import Homebrew
from .base import WSSAPI
# Init Logging Facilities
log = logging.getLogger(__name__)
class GDAXWSS(WSSAPI):
def __i... |
command.py | # Copyright 1996-2020 Cyberbotics Ltd.
#
# 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... |
camgear.py | """
===============================================
vidgear library source-code is deployed under the Apache 2.0 License:
Copyright (c) 2019-2020 Abhishek Thakur(@abhiTronix) <abhi.una12@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance wi... |
async_command.py | import os
import sys
import time
from subprocess import PIPE, Popen
from threading import Thread
from queue import Queue, Empty
ON_POSIX = 'posix' in sys.builtin_module_names
[PENDING, RUNNING, STOPPED] = range(3) # Command state enum
class AsyncCommand:
# Assign a command that will be run in a separate thread... |
Hiwin_RT605_ArmCommand_Socket_20190627174537.py | #!/usr/bin/env python3
# license removed for brevity
import rospy
import os
import socket
##多執行序
import threading
import time
import sys
import matplotlib as plot
import HiwinRA605_socket_TCPcmd as TCP
import HiwinRA605_socket_Taskcmd as Taskcmd
import numpy as np
from std_msgs.msg import String
from ROS_Socket.srv imp... |
run_unittests.py | #!/usr/bin/env python3
# Copyright 2016-2017 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by ... |
test_tracer.py | # -*- coding: utf-8 -*-
"""
tests for Tracer and utilities.
"""
import contextlib
import multiprocessing
import os
from os import getpid
import threading
from unittest.case import SkipTest
import mock
import pytest
import ddtrace
from ddtrace.constants import ENV_KEY
from ddtrace.constants import HOSTNAME_KEY
from dd... |
addpapers.py | import queryCiteFile
import librarybase
import pywikibot
from epmclib.getPMCID import getPMCID
from epmclib.exceptions import IDNotResolvedException
import queue
import threading
import time
def rununthreaded():
citefile = queryCiteFile.CiteFile()
citations = citefile.findRowsWithIDType('pmc')
... |
logging_util.py | __package__ = 'archivebox'
import re
import os
import sys
import stat
import time
import argparse
from math import log
from multiprocessing import Process
from pathlib import Path
from datetime import datetime, timezone
from dataclasses import dataclass
from typing import Any, Optional, List, Dict, Union, IO, TYPE_CH... |
base_socketsM.py |
import tornado.websocket
import json
from multiprocessing import Process
import definitions
SERVER = definitions.SERVER
class SuperBaseSocket(tornado.websocket.WebSocketHandler):
def open(self, id_sessions, Session):
_id = self.get_argument("id", None, True)
if not _id:
... |
drive_cleanup.py | import logging
import threading
from datetime import datetime, timedelta
from threading import Thread
from apiclient import discovery
logger = logging.getLogger(__name__)
DELAY_SECS = 60 * 5
MAX_FOLDER_AGE_MINS = 60 # An hour
class DriveCleanup:
SCOPES = 'https://www.googleapis.com/auth/drive'
drive = None... |
sys_agent_unit.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
#
# Licensed under the GNU General Public License, version 3 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://jxs... |
client.py | import socket, threading, time
key = 0
server = ('192.168.1.49',9090) # default server
host = socket.gethostbyname(socket.gethostname())
#host = '192.168.1.49'
port = 0
shutdown = False
join = False
def receiving (name, sock):
while not shutdown:
try:
while True:
data, addr = sock.recvfrom(1024)
my_t... |
regrtest.py | #! /usr/bin/env python3
"""
Script to run Python regression tests.
Run this script with -h or --help for documentation.
"""
USAGE = """\
python -m test [options] [test_name1 [test_name2 ...]]
python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]]
"""
DESCRIPTION = """\
Run Python regression tes... |
server.py | """Zmq based measurement server"""
# based on https://learning-0mq-with-pyzmq.readthedocs.org/en/latest/pyzmq/patterns/pushpull.html
import zmq
import json
import socket as python_socket
import telnetlib
from threading import Thread
import time
import sys
def streamer_device(port_in, port_out):
from zmq.devices... |
object_storage_service_benchmark.py | # Copyright 2016 PerfKitBenchmarker 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 appli... |
caching.py | import json
import logging
import threading
import redis
import time
LOG = logging.getLogger(__name__)
def bootstrap_cache(host='127.0.0.1', password=None):
pool = redis.ConnectionPool(host=host, password=password)
return redis.StrictRedis(connection_pool=pool)
def connect_to_cache():
import os
c... |
lisp-itr.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... |
midbrain.py | import os
import sys
import math
import time
import numpy as np
import abe_sim.brain.geom as geom
from abe_sim.brain.cerebellum import Cerebellum
from abe_sim.brain.geom import angle_diff, euler_to_quaternion, euler_diff_to_angvel, invert_quaternion, quaternion_product, quaternion_to_euler, poseFromTQ
import random
... |
email.py | from threading import Thread
from flask import current_app
from flask_mail import Message
from app import mail
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(subject, sender, recipients, text_body, html_body, attachments=None, sync=False):
msg = Mes... |
converter.py | import ffmpeg
import subprocess
import os
from enum import Enum
from threading import Thread
_MKV_FILE_PATH_FORMAT = 'D:/1-mkv/{:02d}.mkv'
_SUB_FILE_PATH_FORMAT = 'C\\:\\\\1-sub\\\\{:02d}.ass'
_CONVERTING_FOLDER_PATH_FORMAT = 'C:/2-converting/{:02d}/'
_CONVERTING_VIDEO_NAME_FORMAT = 'video.avc'
_CONVERTING_AUDIO_NAME... |
main.py | import json
import mimetypes
import os
import pstats
import string
import threading
import webbrowser
from http.server import BaseHTTPRequestHandler, HTTPServer
from .__about__ import __version__
from .module_groups import built_in, built_in_deprecated
try:
from html import escape
except ImportError:
from cgi... |
custom.py | # pylint: disable=too-many-lines
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------... |
test_linsolve.py | from __future__ import division, print_function, absolute_import
import threading
import numpy as np
from numpy import array, finfo, arange, eye, all, unique, ones, dot, matrix
import numpy.random as random
from numpy.testing import (
assert_array_almost_equal, assert_raises, assert_almost_equal,
asse... |
test_operator.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 u... |
client.py | import requests
import json
import threading
import speech_recognition as sr
import logging
from flask import Flask, request
from speech_handling.text_to_speech import SapiTTS, GoogleTTS
logger = logging.getLogger(__name__)
app = Flask(__name__)
tts = GoogleTTS()
recognizer = sr.Recognizer()
def send_message_to_vo... |
transport.py | import connection
from dht import DHT
from protocol import hello_request
from protocol import hello_response
from protocol import goodbye
from protocol import proto_response_pubkey
from urlparse import urlparse
from zmq.eventloop import ioloop, zmqstream
from zmq.eventloop.ioloop import PeriodicCallback
from collection... |
runtests.py | #!/usr/bin/env python
import os
import re
import sys
import glob
import subprocess
from ctypes import c_int
from multiprocessing import Process, Lock, Value, BoundedSemaphore, cpu_count
#---------------------------------------------------------------------
# Extract scenarios from the specified test
def runTest(test... |
types_serialization_test.py | # Copyright 2017-2019 typed_python 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... |
dmax_set.py | #!/usr/bin/python
import os
import fnmatch
from multiprocessing import Process
import process_cup
def process_set(cups_dir, set_tag, idx_start, idx_stop, sym_Y = False):
"""
Process all shots for both collimators for a given cup tag
Parameters
----------
cups_dir: string
location of the... |
bench_test.py | """
Define benchmark tests
"""
# stdlib
import atexit
from multiprocessing import Process
from multiprocessing import set_start_method
import os
import time
from typing import Any
# third party
import pytest
# syft absolute
import syft as sy
# syft relative
from ...syft.grid.duet.signaling_server_test import run
fro... |
test_examples.py | import itertools
import multiprocessing
import runpy
import sys
from os import path as osp
import pytest
def run_main(*args):
# patch sys.args
sys.argv = list(args)
target = args[0]
# run_path has one difference with invoking Python from command-line:
# if the target is a file (rather than a dire... |
test_utility.py | import threading
import pytest
from base.client_base import TestcaseBase
from base.utility_wrapper import ApiUtilityWrapper
from utils.util_log import test_log as log
from common import common_func as cf
from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks
prefix = "utility"
defau... |
youtubequeue.py | import os
import settings
settings.generateConfigFile()
import soundfile as sf
from pydub import AudioSegment
import generatorclient
from time import sleep
from subprocess import *
import videouploader
from threading import Thread
import pickle
import datetime
from datetime import timedelta
from PIL import... |
capture_screenlapse.py | # #!/usr/bin/env python
"""
Description:
A simple screen capture utility, built with ease of use in mind, possibly buggy.
- Adjust capture speed on the fly (1x,5x,10x)
- Choose which screen to capture (main,external)
- Visual counter of captured images
Instruction:
First make sure you have changed the Reco... |
forgotten.py | # -*- coding: utf-8 -*-
#
# forgotten
# https://github.com/rmed/forgotten
#
# The MIT License (MIT)
#
# Copyright (c) 2017 Rafael Medina García <rafamedgar@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), ... |
message_sender.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import requests
import threading
import logging
from alfa_agent.core.api.util.util import Util
class MessageSender:
def __init__(self, url):
self.url = url
self.headers = {'content-type': 'application/json'}
def send(self, payload):
... |
main.py | from utils import *
from process import *
from server import run_server
import multiprocessing,requests
p = multiprocessing.Process(target=run_server, args=())
p.daemon = True
path_volume= abspath(__file__)+"_data/"
keyword= "ok assistant"
list_stop= get_tree_by_tag("start>stop")['keywords']
volumes={str(path_volume)... |
dynamodump.py | #!/usr/bin/env python
"""
Simple backup and restore script for Amazon DynamoDB using boto to work similarly to mysqldump.
Suitable for DynamoDB usages of smaller data volume which do not warrant the usage of AWS
Data Pipeline for backup/restores/empty.
dynamodump supports local DynamoDB instances as w... |
safe_t.py | from binascii import hexlify, unhexlify
import traceback
import sys
from electrum_axe.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from electrum_axe.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT
from electrum_axe.bip32 import BIP32Node
from electrum_axe import constants
from electrum_axe.i18n imp... |
apimodules.py | import urllib.parse
import urllib.request, urllib.error
import secrets
import hashlib, hmac, base64
from mimetypes import guess_all_extensions
from datetime import datetime
from copy import deepcopy
import re
import os, sys, time
import io
from collections import OrderedDict
import threading
from PySide2.QtWebEngineW... |
main.py | #!/usr/bin/env python3
import os
import sys
import select
import termios
import copy
from threading import Lock, Thread
from terminal import Terminal
def io_func(tty):
while True:
rlist, wlist, xlist = select.select([sys.stdin, tty.tty_fd], [], [])
if tty.tty_fd in rlist:
out = tty.r... |
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... |
server.py | import socket
from threading import Thread
SERVER = None
PORT = None
IP_ADDRESS = None
CLIENTS = {}
# Boilerplate Code
def handleClient(player_socket,player_name):
global CLIENTS
# Sending Initial message
playerType = CLIENTS[player_name]["player_type"]
if(playerType== 'player1'):
CLIENTS[... |
_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... |
app.py | import socket
import sys
from threading import Thread
import json
import os
HOST = "127.0.0.1"
PORT = 80
MAX_BUFFER_SIZE = 1024
def main():
initialize_database()
start_server()
# Creates database file
def initialize_database():
# Create database file
if not os.path.exists("db.json"):
with ... |
remoteapp.py | '''
A utility for creating "remote applications" which are dcode
enabled and cobra driven. All API arguments/returns *must* be
serializable using msgpack.
NOTE: enabling a dcode server means source for local python modules
will be delivered directly to clients over the network!
Running a remote application wil... |
tk_dml.py | # coding=utf-8
# @Time: 2021/8/20 14:38
# @Author: forevermessi@foxmail.com
"""
Usage:
支持以下几种大批量DML语句:
delete from <t> where <...>
update <t> set <...> where <...>
insert into <t_to> select <...> from <t_from> where <...>
默认使用_tidb_rowid(或数字主键)作为拆分列,不支持设置了SHARD_ROW_ID_BITS或auto_random的表
... |
client.py | # -*- encoding: utf-8 -*-
"""
@File :client.py
@Desc :客户端
@Date :2022-03-03 10:42
"""
import threading
from datetime import datetime
from functools import lru_cache
import zmq
from zmq.auth.thread import ThreadAuthenticator
from zmq.backend.cython.constants import NOBLOCK
from .exception import R... |
clients.py | import os
import psutil
import requests
import threading
from wafec_wrapt_custom.utility import fullname
base_url = os.environ.get('WWC_URL')
base_url = base_url if base_url else 'http://localhost:6543'
def _safe_run(target, args, kwargs):
try:
target(*args, **kwargs)
except:
pass
def _pos... |
http.py | __all__ = ["serve_fs"]
import SimpleHTTPServer
import SocketServer
from fs.path import pathjoin, dirname
from fs.errors import FSError
from time import mktime
from cStringIO import StringIO
import cgi
import urllib
import posixpath
import time
import threading
import socket
def _datetime_to_epoch(d):
return mktim... |
worker.py | import multiprocessing as mp
from abc import ABC, abstractmethod
class Worker(ABC):
"""
A generic worker class to implement other class based functionalities using
multi-processing
"""
@abstractmethod
def main(self):
# This function has to be implemented by the base class
pass
@property
... |
main.py | import sys
import threading
import time
from socket import *
class Peer():
def __init__(self):
super().__init__()
self.client_socket_udp = socket(AF_INET, SOCK_DGRAM)
self.server_socket_udp = socket(AF_INET, SOCK_DGRAM)
self.server_socket_tcp = socket(AF_INET, SOCK_STREAM)
... |
FFmpegPipeline.py | '''
* Copyright (C) 2019 Intel Corporation.
*
* SPDX-License-Identifier: BSD-3-Clause
'''
from modules.Pipeline import Pipeline # pylint: disable=import-error
from modules.PipelineManager import PipelineManager # pylint: disable=import-error
from modules.ModelManager import ModelManager # pylint: disable=import-err... |
interact.py | import os
import sys
import time
import types
import multiprocessing
import cv2
from tqdm import tqdm
try:
import IPython #if success we are in colab
from IPython.display import display, clear_output
import PIL
import matplotlib.pyplot as plt
is_colab = True
except:
is_colab = False
class Inte... |
conf_snapper.py | #!/usr/bin/python
"""
This is a script that runs configuration snapper for Btrfs. Configuration is provided
in a file.
"""
import argparse
import datetime
import json
import logging
import os
import signal
import socket
import sys
import threading
import time
import traceback
# requires installation of sche... |
mosaic.py | import sys
import os, os.path
from PIL import Image, ImageOps
from multiprocessing import Process, Queue, cpu_count
# Change these 3 config parameters to suit your needs...
TILE_SIZE = 50 # height/width of mosaic tiles in pixels
TILE_MATCH_RES = 5 # tile matching resolution (higher values give better fit but re... |
neuron.py | import random
import itertools
import time
import signal
from threading import Thread
from multiprocessing import Pool
import multiprocessing
POTENTIAL_RANGE = 110000 # Resting potential: -70 mV Membrane potential range: +40 mV to -70 mV --- Difference: 110 mV = 110000 microVolt --- https://en.wikipedia.org/wiki/Membr... |
analyze_document_controller.py | from datetime import timedelta
from flashtext import KeywordProcessor
from intent_parser.intent_parser_exceptions import IntentParserException
import intent_parser.utils.intent_parser_utils as ip_utils
import logging
import os
import threading
import time
class AnalyzeDocumentController(object):
LOGGER = logging.... |
worldnews1.py | import re
from bs4 import BeautifulSoup
from bs4 import SoupStrainer
import os
import httplib2
from multiprocessing import Pool
c=0
import requests
from datetime import datetime
import multiprocessing
from multiprocessing import current_process
import time
import os
import sys
FORMAT = '%d-%m-%Y %H:%M:%S'
my=open('log.... |
foo.py | # Python 3.3.3 and 2.7.6
# python fo.py
from threading import Thread
# Potentially useful thing:
# In Python you "import" a global variable, instead of "export"ing it when you declare it
# (This is probably an effort to make you feel bad about typing the word "global")
i = 0
def incrementingFunction():
glob... |
utils.py |
import json
import sys
import re
import os
import stat
import fcntl
import shutil
import hashlib
import tempfile
import subprocess
import base64
import threading
import pipes
import uuid
import codecs
import zipfile
try:
from collections.abc import Iterable, Mapping
except ImportError:
from collections import... |
test_util.py | # Copyright 2017-2020 typed_python 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... |
main.pyw | '''Sudoku Solver Main Module'''
import tkinter
from tkinter import ttk # Used for scrollbar
from tkinter import messagebox # Used for message boxes
from tkinter import filedialog # Used for opening the file dialog box
import copy # Used for creating copies of variables instead of instances
import threading # Multit... |
agent.py | #!/usr/bin/env python2
# coding: utf-8
import requests
import time
import os
import subprocess
import platform
import shutil
import sys
import traceback
import threading
import uuid
import StringIO
import zipfile
import tempfile
import socket
import getpass
if os.name == 'nt':
from PIL import ImageGrab
else:
i... |
soundmonitor.py | # Python 3.8.2
# Started on 2020-05-14 by Dylan Halladay
""" Program to monitor audio input levels
and react to noises in realtime.
PLEASE READ
This program prioritizes reaction time over
efficient RAM/CPU usage. As such, several
single-task child processes will be s... |
custom.py | # pylint: disable=too-many-lines
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------... |
Clustered.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import bisect
from threading import Thread, Lock
from collections import OrderedDict
from .Tools import *
from .debug import Debug
from .debug import BColors
import json
if sys.version_info[0] == 3:
from queue import Queue, Empty
else:
from Queue import Queue, Empt... |
Isonet_app.py |
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import QObject, pyqtSlot
from IsoNet.gui.mainwindow_v3 import Ui_MainWindow
import sys
import os
from IsoNet.gui.model import Model
import time
from threading import Thread
class MainWindowUIClass( Ui_MainWindow ):
def __init__( self ):
... |
Virtual_controller_to_wifi.py | import socket
import struct
import sys
import time
from time import time as tt
import numpy as np
import os.path
from openframeworks import *
from protopixel import Content
import socket
UDP_IP = "192.168.1.100"
UDP_PORT = 2390
content = Content('Virtual controller')
content.add_parameter("FPS_LIMIT", min=0, max=60... |
test_basic.py | import gc
import re
import sys
import time
import uuid
import weakref
from datetime import datetime
from platform import python_implementation
from threading import Thread
import pytest
import werkzeug.serving
from werkzeug.exceptions import BadRequest
from werkzeug.exceptions import Forbidden
from werkzeug.exceptions... |
maskdetector.py | #import required libraries
from tensorflow.keras.applications.mobilenet_v2 import preprocess_input
from tensorflow.keras.preprocessing.image import img_to_array
from tensorflow.keras.models import load_model
from imutils.video import VideoStream
import numpy as np
import argparse
import imutils
import serial
import ... |
plant-main.py | #!/usr/bin/env python
# Copyright 2019 Dynamic Object Language Labs Inc.
#
# This software is licensed under the terms of the
# Apache License, Version 2.0 which can be found in
# the file LICENSE at the root of this distribution.
# A trivial example of a plant that executes any command for 2 seconds.
# This is for... |
profile_plugin.py | # Copyright 2019 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... |
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 hashlib
import hmac
import socket
import smtpd
import smtplib
import io
import re
import sys
import time
import select
import er... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.