source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
relay_integration.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... |
_exit_scenarios.py | # Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
bctides.py | from datetime import datetime, timedelta
import pathlib
from typing import Dict, Union
import logging
from pyschism import dates
from pyschism.mesh.vgrid import Vgrid
from pyschism.forcing.bctides import iettype, ifltype, isatype, itetype, itrtype, Tides
from pyschism.forcing.bctides.elev2d import Elev2D
from pyschis... |
main.py | import requests
import json
import sys
import traceback
import time
import re
import os
import threading
# User-Agent
userAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6"
# Export Log
exportLog = False
# Export Log File
exportLogfile = "log.txt"
# Api Address
apiAdd... |
EventHandler.py | """EventHandler for the Teamspeak3 Bot."""
import ts3.Events as Events
import logging
import threading
class EventHandler(object):
"""
EventHandler class responsible for delegating events to registered listeners.
"""
logger = logging.getLogger("eventhandler")
logger.setLevel(logging.INF... |
client_test.py | # Copyright 2020 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 applicable ... |
test_RHW.py | import zmq
adr = 'tcp://127.0.0.1:6001'
context = zmq.Context()
pub = context.socket(zmq.PUB)
pub.setsockopt_unicode(zmq.IDENTITY, 'publisher')
pub.bind(adr)
sub = context.socket(zmq.SUB)
poller = zmq.Poller()
poller.register(sub, zmq.POLLIN)
sub.setsockopt(zmq.SUBSCRIBE, b"")
sub.set_hwm(1)
#sub.setsockopt(zmq.RCVHWM,... |
_led.py | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
DAN.py | import requests, time, csmapi, random, threading
# example
profile = {
'd_name': None,
'dm_name': 'MorSensor',
'u_name': 'yb',
'is_sim': False,
'df_list': ['Acceleration', 'Temperature'],
}
mac_addr = 'C860008BD249'
state = 'SUSPEND' #for control channel
#state = 'RESUME'
Sele... |
server.py | # lsof -n -i4TCP:32757 | grep LISTEN | awk '{ print $2 }' | xargs kill
import socket
from contextlib import suppress
with suppress(Exception):
from Server import runtime
from Server import database
with suppress(Exception):
import runtime
import database
import threading
from pyftpdlib.authorizers imp... |
learn.py | #!/usr/bin/env python3
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib'))
from support import Database, Config
import numpy as np
import queue, math, socket, subprocess, support, threading
import tensorflow as tf
class Learn:
def __init__(self, config):
graph = tf.Graph(... |
notebookapp.py | # coding: utf-8
"""A tornado based IPython notebook server.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPY... |
overcast.py | """
An overcast "API".
Overcast doesn't really offer an official API, so this just sorta apes it.
"""
import requests
import lxml.html
import urlparse
import utilities
import logging
import threading
log = logging.getLogger('overcast-sonos')
class Overcast(object):
def __init__(self, email, password):
... |
vrobbie.py | #!/usr/bin/python
import json
import logging
import requests
import collections
import time
import re
import sys
import os
from threading import Thread
from operator import itemgetter
from itertools import groupby
from flask import Flask, render_template
from flask_ask import Ask, statement, question, session, request... |
rewind.py | import logging
import os
import shlex
import six
import subprocess
from threading import Lock, Thread
from .connection import get_connection_cursor
from .misc import format_lsn, parse_history, parse_lsn
from ..async_executor import CriticalTask
from ..dcs import Leader
logger = logging.getLogger(__name__)
REWIND_ST... |
tk2thread.py | import queue
import threading
import time
import tkinter
from tkinter import ttk
the_queue = queue.Queue()
def thread_target():
while True:
message = the_queue.get()
if message is None:
print("thread_target: got None, exiting...")
return
print("thread_target: doin... |
smarthome.py | # -*- coding: utf-8 -*-
import hashlib
import os
import re
import subprocess
import sys
import threading
from collections.abc import Mapping
from itertools import product
import requests
import trait
from auth import *
from const import (DOMOTICZ_TO_GOOGLE_TYPES, ERR_FUNCTION_NOT_SUPPORTED, ERR_PROTOCOL_ERROR, ERR_D... |
basemangacrawler.py | """
An abstract base class for a Manga with Chapters.
"""
import os
import json
import shutil
import logging
from time import sleep
from typing import List, Any
from queue import Empty, Queue
from functools import lru_cache
from threading import Thread, Event
from abc import ABC, abstractmethod
import requests
from t... |
awss3.py | from __future__ import division
from outputplugin import OutputPlugin
import requests
try:
import boto3
import botocore.exceptions
boto_imported = True
except ImportError:
boto_imported = False
import uuid
import datetime
import threading
import logging
def threaded(fn):
def wrapper(*args, **kwarg... |
tests.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_telnetlib.py | import socket
import selectors
import telnetlib
import threading
import contextlib
from test import support
from test.support import socket_helper
import unittest
support.requires_working_socket(module=True)
HOST = socket_helper.HOST
def server(evt, serv):
serv.listen()
evt.set()
try:
conn, addr... |
HttpEndpoint.py | # -*- coding: utf-8 -*-
"""
pip_services3_rpc.services.HttpEndpoint
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Http endpoint implementation
:copyright: Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
import json
import re
import tim... |
test_itertools.py | import unittest
from test import test_support
from itertools import *
import weakref
from decimal import Decimal
from fractions import Fraction
import sys
import operator
import random
import copy
import pickle
from functools import reduce
try:
import threading
except ImportError:
threading = None
maxsize = tes... |
unzip.py | import os
import threading
import time
import zipfile
from src import UNZIPED_FOLDER_NAME
from src.io.get_files_dict import main as get_files_dict
from src.io.utils import create_folder, check_if_folder_is_empty, display_progress
dict_status = {}
chunk_size = 1024 * 1024 * 2
def main(folder_to_unzip=No... |
tb_device_http.py | """ThingsBoard HTTP API device module."""
import threading
import logging
import queue
import time
import typing
from datetime import datetime, timezone
from sdk_utils import verify_checksum
import requests
from math import ceil
FW_CHECKSUM_ATTR = "fw_checksum"
FW_CHECKSUM_ALG_ATTR = "fw_checksum_algorithm"
FW_SIZE_A... |
main.py | from __future__ import print_function, division
import os
os.environ["OMP_NUM_THREADS"] = "1"
import argparse
import torch
import torch.multiprocessing as mp
from environment import atari_env
from utils import read_config
from model import A3Clstm
from train import train
from test import test
from shared_optim import S... |
test_events.py | """Tests for events.py."""
import collections.abc
import functools
import gc
import io
import os
import platform
import re
import signal
import socket
try:
import ssl
except ImportError:
ssl = None
import subprocess
import sys
import threading
import time
import errno
import unittest
from unittest import mock
... |
server.py | import sys
import socket
import atexit
import threading
HOST = "127.0.0.1"
PORT = 23333
MAX_CONNECTIONS = 8
MAX_BUFFER_SIZE = 2048
ENCODING = "utf-8"
if len(sys.argv) > 2:
HOST = sys.argv[1]
PORT = int(sys.argv[2])
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
# str:connection
u... |
algo_two.py | from functools import reduce
from sys import *
import numpy as np
import random as r
import socket
import struct
import subprocess as sp
import threading
from threading import Thread
import ast
import time
import datetime as dt
import os
import psutil
from netifaces import interfaces, ifaddresses, AF_INET
import paho.m... |
PcapParser.py | # Copyright (C) 2016 Manmeet Singh, Maninder Singh, Sanmeet kour
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE... |
utils.py | import os
from config import *
import random
import json
from tqdm import tqdm
from sql_formatter.formatting import translate_sql
import sqlite3
import multiprocessing
from multiprocessing import Manager
import time
random.seed(33)
def mkdir(path):
if os.path.exists(path):
print("{} already exists".format... |
managers.py | #
# Module providing manager classes for dealing
# with shared objects
#
# multiprocessing/managers.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token' ]
#
# Imports
#
import sys
import threading
... |
app.py | from tkinter import *
from tkinter.ttk import Combobox
import tkinter.messagebox
import threading
import socket
import time
class Dos:
def __init__(self,root):
self.root=root
self.root.title("DOS ATTACK")
self.root.geometry("450x400")
self.root.iconbitmap("logo980.ico")
s... |
TServer.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... |
kb_HelloWorldServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, Inva... |
pipeline.py | #!/usr/bin/env python3
import hashlib
import threading
import networkx as nx # type: ignore
import os
import sys
import signal
import socket
import time
import re
import resource
from collections import defaultdict
from datetime import datetime
import subprocess
from shlex import split
from multiprocessing import Pr... |
exchange_client.py | # from abc import ABC, abstractmethod
from time import sleep, time
import requests
import sys
from silver_waffle.base.side import ASK, BID
from silver_waffle.base.exchange import Order, Currency, Pair
from silver_waffle.credentials import Credential
import silver_waffle.credentials
from random import randint
import jso... |
test_i18n.py | import threading
from goodboy.i18n import get_current_locale, set_process_locale, set_thread_locale
def test_set_process_locale():
set_process_locale(["process_locale_name"])
assert get_current_locale() == ["process_locale_name"]
def test_set_thread_locale():
set_process_locale(["main_thread_locale"])
... |
motors.py | import RPi.GPIO as GPIO
import time
import threading
usleep = lambda x: time.sleep(x/1000.0/1000.0)
coordToSteps = 2000.0 / 6.0
RESET_POS = [-0.22, -0.64] # 6.6cm/grid -4cm/6.6=-0.6, -1.5cm/6.6=-0.22
# Mot1 on board, Mot2 below
dirPin = [29,33]
stepPin = [31,35]
sleepPin = [32,36]
triggerPin = [16,40]
triggerSet = [F... |
sshshell.py | """
SSH shell implementation.
"""
import logging
import select
import socket
import StringIO
import subprocess
import threading
import time
import uuid
import paramiko
from scp import SCPClient
from jammy.exceptions import JammyError, CommandError, CommandTimeout, SshError
from jammy.waituntil import retry_on_excep... |
marshal.py | # Copyright 2019 Atalaya Tech, 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 writing, ... |
window_title_change.py | import webview
import threading
import time
'''
This example demonstrates how to change a window title.
'''
def change_title():
"""changes title every 3 seconds"""
for i in range(1, 100):
time.sleep(3)
webview.set_title("New Title #{}".format(i))
if __name__ == '__main__':
t = threading... |
__init__.py | from __future__ import print_function
import sys
if sys.version_info[0] < 3:
print("pkuseg does not support python2", file=sys.stderr)
sys.exit(1)
import os
import time
import pickle as pkl
import multiprocessing
from multiprocessing import Process, Queue
import pkuseg.trainer as trainer
import pkuseg.infer... |
main.py | #/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Publ... |
httpclient_test.py | # -*- coding: utf-8 -*-
import base64
import binascii
from contextlib import closing
import copy
import threading
import datetime
from io import BytesIO
import time
import typing # noqa: F401
import unicodedata
import unittest
from tornado.escape import utf8, native_str
from tornado import gen
from tornado.httpclient... |
tcp_server.py | import socket
import threading
bind_ip = "127.0.0.1"
bind_port = 4567
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((bind_ip, bind_port))
# 最大连接数5
server.listen(5)
print("[*] 监听中:%s:%d" %(bind_ip, bind_port))
# 处理客户端线程
def handle_client(client_socket):
# 输出客户端发来的数据
request = client... |
csi_camera.py | # MIT License
# Copyright (c) 2019,2020 JetsonHacks
# See license in root folder
# CSI_Camera is a class which encapsulates an OpenCV VideoCapture element
# The VideoCapture element is initialized via a GStreamer pipeline
# The camera is read in a separate thread
# The class also tracks how many frames are read from t... |
commands.py | #
# Copyright (c) 2013-2014 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
# DESCRIPTION
# This module is mainly used by scripts/oe-selftest and modules under meta/oeqa/selftest
# It provides a class and methods for running commands on the host in a convienent way for tests.
import os
import sys
import signal... |
update.py | from threading import Thread
from datums_warehouse.db import make_warehouse
def update_pairs(cfg, pairs):
def update_pair(wh_cfg, pair):
wh = make_warehouse(wh_cfg)
wh.update(pair)
processes = [Thread(target=update_pair, name=f"process: {p}", args=(cfg, p)) for p in pairs]
for prc in pr... |
file_broswer.py | # -*- coding:utf-8 -*-
import bimpy
from glob import glob
from multiprocessing import Process, Queue
import pickle
from Modules.i18n import LANG_EN as LANG
from Modules.conf import conf
from Modules.preprocess import preprocess
class file_broswer:
file_list = []
q = Queue()
def __init__(self):
... |
baseline_racer.py | from argparse import ArgumentParser
import airsimneurips as airsim
# import cv2
import threading
import time
import utils
import numpy as np
import math
# drone_name should match the name in ~/Document/AirSim/settings.json
class BaselineRacer(object):
def __init__(self, drone_name = "drone_1", viz_traj=True, viz_t... |
am_completions_generate.py | import re
from os import listdir, walk, makedirs
from os.path import isdir, isfile, join, split
import errno
import json
import pickle
import collections
import time
import threading
import sublime
import sublime_plugin
def plugin_loaded():
"""Do imports that need to wait for Sublime API initilization
"""
... |
installwizard.py |
from functools import partial
import threading
import os
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ObjectProperty, StringProperty, OptionProperty
from kivy.core.window import Window
from kivy.uix.button import Button
from kivy.utils import platform... |
scanner.py | from multiprocessing import Process, Value
from ctypes import c_bool
import os
import time
from .spectrum_reader import SpectrumReader
class Scanner(object):
interface = None
freqlist = None
process = None
debugfs_dir = None
spectrum_reader = None
def __init__(self, interface):
self.i... |
acs_client.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
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... |
cli.py | import ast
import inspect
import os
import platform
import re
import sys
import traceback
import warnings
from functools import update_wrapper
from operator import attrgetter
from threading import Lock
from threading import Thread
import click
from werkzeug.utils import import_string
from .globals import current_app
... |
player.py | import xbmc
import xbmcgui
import threading
import copy
import os
import urllib
from lib import util
from lib.tablo import bif
from lib.windows import kodigui
from lib.util import T
class TrickModeWindow(kodigui.BaseWindow):
name = 'TRICKMODE'
xmlFile = 'script-tablo-trick-mode.xml'
path = util.ADDON.get... |
worker.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import atexit
import collections
import colorama
import hashlib
import inspect
import numpy as np
import os
import redis
import signal
import sys
import threading
import time
import traceback
# Ray modules
imp... |
Timer.py | import threading
import multiprocessing
import platform
TIME = 0.1 # seconds for one turn
class Timer():
def call_timeout(timeout, func, args=(), kwargs={}):
try:
p = multiprocessing.Process(target=func, args=args, kwargs=kwargs)
p.start()
p.join(timeout)
... |
test.py | # Copyright 2013 dotCloud 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 w... |
server.py | import os, sys, time
from typing import Dict, List, Union
import json
import logging
import socket
from _thread import start_new_thread
from threading import Lock
from multiprocessing import Pipe, Process, Queue, Manager
from multiprocessing.connection import Connection
# from queue import SimpleQueue
from dopt impo... |
vpn.py | import os
import sys
import colorama
import threading
import webbrowser
import subprocess
import gh_md_to_html
import tkinter.messagebox
cwd = os.getcwd()
colorama.init(autoreset=True)
def run(command: str, *args, **kwargs):
return subprocess.run(command, shell=True) or True
def run_threaded(command: str, thread... |
timed_subprocess.py | # -*- coding: utf-8 -*-
'''For running command line executables with a timeout'''
from __future__ import absolute_import
import subprocess
import threading
import salt.exceptions
from salt.ext import six
class TimedProc(object):
'''
Create a TimedProc object, calls subprocess.Popen with passed args and **kwa... |
test_urllib.py | """Regression tests for what was in Python 2's "urllib" module"""
import urllib.parse
import urllib.request
import urllib.error
import http.client
import email.message
import io
import unittest
from unittest.mock import patch
from test import support
import os
try:
import ssl
except ImportError:
ssl = None
imp... |
multiThreadingRaceConditionSolution.py | import threading
# global variable x
x = 0
def increment():
"""
function to increment global variable x
"""
global x
x += 1
def thread_task(lock):
"""
task for thread
calls increment function 100000 times.
"""
for _ in range(100000):
lock.acquire()
increment... |
pytorch.py | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import atexit
import logging
import os
import socket
import time
from dataclasses import dataclass
from pathlib import Path
from subprocess import Popen
from threading import Thread
from typing import Any, List, Optional, Union
import colorama
i... |
v2_integration.py | # -*- coding: utf-8 -*-
"""
Integration test cases for ACMEv2 as implemented by boulder-wfe2.
"""
import subprocess
import requests
import datetime
import time
import os
import json
import re
import OpenSSL
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat... |
tester.py | # Copyright (c) 2014-2015 Dropbox, 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... |
reciver.py | import socket
from os import popen
from multiprocessing import Process
s = socket.socket()
ip=(popen("hostname -I | awk '{print $1}'").read()).strip()
port = 15450
b = "\033[35m"
w = "\033[0m"
for i in range(100):
temip=ip[:-1]+str(i)
try:
s.connect((temip, port))
break
except (Connect... |
tests.py | # -*- coding: utf-8; -*-
#
# Licensed to CRATE Technology GmbH ("Crate") under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. Crate licenses
# this file to you under the Apache License, Version 2.0 (the "License"... |
server.py | # FIXME: Make a Python Unit test
import logging
import queue
import socket
import time
from glob import glob
from http.server import HTTPServer, BaseHTTPRequestHandler
from threading import Thread
from pymjpeg import Image, boundary, request_headers, FileImage
logging.basicConfig(level=logging.DEBUG)
class FileImag... |
master.py | from fastapi import FastAPI, File, UploadFile, Request, Cookie, HTTPException
import uvicorn
import argparse
import json
import aiohttp
import requests
import multiprocessing
from cytomine import Cytomine
from cytomine.models import CurrentUser
from io import BufferedReader, BytesIO
from collections import defaultdict
... |
util.py | # Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
from __future__ import annotations # Allow subscripting Popen
from dataclasses import dataclass, replace
from datetime... |
opurtbot_foreign.py | import discord
from discord.ext import tasks, commands
import asyncio
import threading
import subprocess
import time
from queue import Queue, Empty
from threading import Thread
from requests import get
import os
import re
chat_reg = re.compile("<[^ ]+>")
q = Queue()
inq = Queue() # queue for discord -> mi... |
MptaWriterThread.py | """
Copyright (C) 2018 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 applicable law or agreed to in writing,
softw... |
classification.py | '''
Copyright 2019 Xilinx 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 writing, software
di... |
test_smtplib.py | import asyncore
import email.mime.text
import email.utils
import socket
import smtpd
import smtplib
import io
import re
import sys
import time
import select
import errno
import base64
import unittest
from test import support, mock_socket
try:
import threading
except ImportError:
threading = None
HOST = suppo... |
transport.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
"""RAMSES RF - RAMSES-II compatble Packet processor.
Operates at the pkt layer of: app - msg - pkt - h/w
"""
import asyncio
import logging
import os
import re
import sys
from datetime import datetime as dt
from datetime import timedelta as td
from multiprocessing impor... |
tools.py | """
Command-line tools for interacting with AWS Batch
-------------------------------------------------
"""
import logging
import threading
import time
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
import boto3
import mypy_boto3_batch as batch
import mypy_boto3_log... |
threads_semaphore.py | """
Semaphore. Limiting the amount of threads executing at once.
Various examples exhibiting Thread use.
"""
from threading import Semaphore
from threading import Thread
from threading import current_thread
import logging
import os
import time
# Environment
ENV = os.environ.get("ENV") or "development"
LOG_LEVEL = os.... |
pigpiosim.py | #!/usr/bin/python3
import sys, os, socket, struct, pigpio, time, configparser
from threading import Thread, Event, Lock
from kivy.app import App
from kivy.lang.builder import Builder
from kivy.uix.gridlayout import GridLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.clock import mainthread
SCREEN = '''
<... |
Translator.py | import asyncio
import hashlib
import json
import threading
import urllib.parse
import requests
from parsimonious import ParseError, VisitationError
from pyseeyou import format
from Util import Configuration, GearbotLogging, Emoji, Utils
LANGS = dict()
LANG_NAMES = dict(en_US= "English")
LANG_CODES = dict(English="en... |
callbacks_test.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
test_token_providers.py | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License
import os
import unittest
from threading import Thread
from asgiref.sync import async_to_sync
from azure.kusto.data._cloud_settings import CloudInfo
from azure.kusto.data._token_providers import *
KUSTO_URI = "https://sdkse2etest.east... |
monitor.py | from multiprocessing import Process
from itertools import groupby
import multiprocessing
import os
import time
from typing import Any
import psutil
import datetime
import json
import queue
from jinja2 import Environment, FileSystemLoader
from .template_base import TemplateBase
from .helpers import datetimeConverter
fro... |
server.py | import math
import os
import queue
import sys
import tempfile
import threading
import time
import uuid
from collections import namedtuple
from concurrent.futures import ThreadPoolExecutor
from threading import Event as ThreadingEventType
import grpc
from dagster import check, seven
from dagster.core.code_pointer impor... |
refactor.py | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Refactoring framework.
Used as a main program, this can refactor any number of files and/or
recursively descend down directories. Imported as a module, this
provides infrastructure to write your own refactoring too... |
plugin.py | '''
Created on 18 déc. 2021
@author: slinux
This file contains the main class to define the plugin
Each plugin must have a plugin.py file which declare a class wxRavenPlugin(PluginObject)
'''
import webbrowser
#import the class form above level, it contains predefined functions to overwrite.
#from plugins.plugin... |
display.py | import curses
import glob
import importlib
import threading
from typing import List
from os.path import dirname, basename, isfile
import castero
from castero import helpers
from castero.config import Config
from castero.database import Database
from castero.downloadqueue import DownloadQueue
from castero.feed import F... |
plugin.py | import threading
from binascii import hexlify, unhexlify
from electrum_xzc.util import bfh, bh2u
from electrum_xzc.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
TYPE_ADDRESS, TYPE_SCRIPT, NetworkConstants)
from electrum_xzc.i18n import _
from electrum_xzc.plugins import B... |
Hiwin_RT605_ArmCommand_Socket_20190627175408.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... |
MPyTerm.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
import tty
import termios
import time
import argparse
import binascii
import re
import shutil
from threading import Thread
from datetime import datetime
try:
import serial
except ImportError:
print("PySerial must be installed, run `pip3 instal... |
engine.py | """"""
import importlib
import os
import traceback
from collections import defaultdict
from pathlib import Path
from typing import Any, Callable
from datetime import datetime, timedelta
from threading import Thread
from queue import Queue
from copy import copy
from vnpy.event import Event, EventEngine
from vnpy.trade... |
views.py | import json
import logging
import os
import sqlite3
from os.path import join
from threading import Thread
from time import sleep
from logging import handlers
from flask import (Response, Blueprint, request, redirect, make_response,
render_template, url_for, flash)
from youtubewatched import write_t... |
server.py | ########################################################################################################
# AI人工智障写作 - https://github.com/BlinkDL/AI-Writer
########################################################################################################
import math
import json
import random
import time
_DEBUG_L... |
test_capture.py | import contextlib
import io
import os
import subprocess
import sys
import textwrap
from io import UnsupportedOperation
from typing import BinaryIO
from typing import Generator
import pytest
from _pytest import capture
from _pytest.capture import _get_multicapture
from _pytest.capture import CaptureManager
from _pytest... |
__init__.py | import os
import sys
import cmd
import time
import serial
import select
import struct
import threading
import cPickle as pickle
from cancat import iso_tp
# defaults for Linux:
serialdev = '/dev/ttyACM0' # FIXME: if Windows: "COM10" is default
baud = 4000000
# command constants (used to identify messages between ... |
test_proxy.py | from nboost.proxy import Proxy
import subprocess
import unittest
import requests
from threading import Thread
from elasticsearch import Elasticsearch
import time
from pprint import pprint
class TestProxy(unittest.TestCase):
def test_travel_tutorial(self):
subprocess.call('docker pull elasticsearch:7.4.2',... |
interactive.py | '''
Interactive launcher
====================
.. versionadded:: 1.3.0
The :class:`InteractiveLauncher` provides a user-friendly python shell
interface to an :class:`App` so that it can be prototyped and debugged
interactively.
.. note::
The Kivy API intends for some functions to only be run once or before the
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.