source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
_serial.py | #
# Copyright (c) 2019 UAVCAN Development Team
# This software is distributed under the terms of the MIT License.
# Author: Pavel Kirienko <pavel.kirienko@zubax.com>
#
import copy
import typing
import asyncio
import logging
import threading
import dataclasses
import concurrent.futures
import serial
import pyuavcan.t... |
devoaudioplayer.py | import os
import configparser
import time
from tkinter import *
import threading
import tkinter.messagebox
from tkinter import filedialog
from tkinter import ttk
from ttkthemes import themed_tk as tk
from pygame import mixer
from pathlib import Path
from functools import partial
from mutagen.mp3 import MP3
# https://... |
suite.py | import asyncio
import os
import re
import signal
import sys
import threading
import time
from asyncio import (
AbstractEventLoop,
CancelledError,
Future,
Task,
ensure_future,
get_event_loop,
new_event_loop,
set_event_loop,
sleep,
)
from contextlib import contextmanager
from subproces... |
transports.py | from abc import ABCMeta, abstractmethod
import threading
import time
import socket
from queue import Queue
import subprocess
from .logging import exception_log, debug
try:
from typing import Callable, Dict, Any, Optional
assert Callable and Dict and Any and Optional and subprocess
except ImportError:
pass
... |
copyutil.py | # cython: profile=True
# 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
# "... |
bruter.py | # Date: 14/02/2020
# Author: SKAR
# Description: Bruter
from time import time, sleep
from lib.browser import Browser
from lib.display import Display
from threading import Thread, RLock
from lib.proxy_manager import ProxyManager
from lib.password_manager import PasswordManager
from lib.const import max_time_t... |
tests.py | import threading
import time
from unittest import mock
from multiple_database.routers import TestRouter
from django.core.exceptions import FieldError
from django.db import (
DatabaseError, NotSupportedError, connection, connections, router,
transaction,
)
from django.test import (
TransactionTestCase, ove... |
simple_alpc.py | import multiprocessing
import windows.alpc
from windows.generated_def import LPC_CONNECTION_REQUEST, LPC_REQUEST
PORT_NAME = r"\RPC Control\PythonForWindowsPORT"
def alpc_server():
server = windows.alpc.AlpcServer(PORT_NAME) # Create the ALPC Port
print("[SERV] PORT <{0}> CREATED".format(PORT_NAME))
ms... |
program.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... |
stats.py | import numpy as np
import os
import shelve
import sklearn.preprocessing as prep
from datetime import datetime
from threading import Thread
from enum import Enum
from queue import Queue
from ilp.constants import EPS_32, EPS_64, STATS_DIR
from ilp.helpers.log import make_logger
STATS_FILE_EXT = '.stat'
class JobType... |
minion.py | # -*- coding: utf-8 -*-
'''
Routines to set up a minion
'''
# Import python libs
from __future__ import absolute_import, print_function, with_statement, unicode_literals
import functools
import os
import sys
import copy
import time
import types
import signal
import random
import logging
import threading
import tracebac... |
h1_h2_traffic_load.py | #!/usr/bin/python
# Copyright 2020-2021 PSNC
# Author: Damian Parniewicz
#
# Created in the GN4-3 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/licens... |
ExperimentServer.py | import os
import time
import grpc
import multiprocessing
import traceback
import numpy as np
from signal import signal, SIGTERM
from concurrent import futures
from threading import Lock
from readerwriterlock import rwlock
from typing import Any, Dict
import tensorboardX
from malib.rpc.chunk import deserialize, recv_c... |
node_t5_ur5_2.py | #! /usr/bin/env python
"""
Controls the UR5 near the bins to pick up boxes from the conveyor.
Borrows methods from :mod:`lib_task5` to aid execution, and uses
multithreading to operate the UR5_2 and conveyor simultaneously.
"""
import os
import threading
import json
import datetime
from math import radians
import ros... |
threadsslecho.py | # Copied from https://github.com/dabeaz/curio/blob/master/examples/bench/threadecho.py
# A simple echo server with threads
from socket import *
from threading import Thread
import ssl
import os
path = os.path.dirname(os.path.abspath(__file__))
KEYFILE = os.path.join(path, "ssl_test_rsa") # Private key
CERTFILE = o... |
services_test.py |
import threading
import unittest
from pycoin.encoding.hexbytes import h2b_rev
from pycoin.services import providers
from pycoin.services.blockchain_info import BlockchainInfoProvider
from pycoin.services.blockcypher import BlockcypherProvider
from pycoin.services.blockexplorer import BlockExplorerProvider
from pycoin... |
controller.py | import re
from copy import copy
from datetime import datetime
from logging import getLogger
from threading import Thread, Event, RLock
from time import time
from attr import attrib, attrs
from typing import Sequence, Optional, Mapping, Callable, Any, Union, List
from ..backend_interface.util import get_or_create_proj... |
low_level_runner.py | # Copyright 2018 Google. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
test_preload.py | import multiprocessing
import os
import shutil
import sys
import tempfile
import urllib.error
import urllib.request
from textwrap import dedent
from time import sleep
import pytest
import tornado
from tornado import web
import dask
from distributed import Client, Nanny, Scheduler, Worker
from distributed.compatibili... |
BrokerActions.py | import sys
import io
import subprocess
import threading
import time
import uuid
import os.path
import requests
import json
from random import randint
from UniqueConfiguration import UniqueConfiguration
from CommonConfiguration import CommonConfiguration
from printer import console_out
class BrokerActions:
def __in... |
test.py | from threading import Thread, Semaphore
from time import sleep
aArrived = Semaphore(0)
bArrived = Semaphore(0)
def aBody():
aArrived.release()
print('a at rendezvous')
bArrived.acquire()
print('a past rendezvous')
def bBody():
bArrived.release()
print('b at rendezvous')
aArrived.acquire()... |
exposition.py | #!/usr/bin/python
from __future__ import unicode_literals
import base64
import os
import socket
import sys
import threading
from contextlib import closing
from wsgiref.simple_server import WSGIRequestHandler, make_server
from prometheus_client import core
from prometheus_client.openmetrics import exposition as openm... |
EZGift.py | from requests.exceptions import ProxyError, SSLError, ConnectionError, InvalidProxyURL, ChunkedEncodingError
import multiprocessing
from colorama import Fore, Style
from threading import Thread
import fake_useragent
import platform
import requests
import random
import string
import json
import time
import re... |
test_concurrent_futures.py | from test import support
from test.support import import_helper
from test.support import threading_helper
# Skip tests if _multiprocessing wasn't built.
import_helper.import_module('_multiprocessing')
from test.support import hashlib_helper
from test.support.script_helper import assert_python_ok
import contextlib
im... |
compatibility_checker_server.py | # Copyright 2018 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
env_test.py | from gibson2.envs.locomotor_env import NavigateRandomEnv, HotspotTravEnv
from time import time, sleep
import numpy as np
import gibson2
import os
from gibson2.core.render.profiler import Profiler
import logging
import math
import cv2 as cv
import threading
from gibson2.utils.utils import quatToXYZW, quatFromXYZW
from t... |
utils.py | import torch
import numpy as np
import torch.nn as nn
import gym
import os
from collections import deque
import random
import copy
import skimage
import torch.multiprocessing as mp
class eval_mode(object):
def __init__(self, *models):
self.models = models
def __enter__(self):
self.prev_states... |
utils.py | import os
import sys
import time
import struct
import zipfile
import threading
import subprocess
import requests
from requests import exceptions
# Import win32api
import win32api
import win32gui, win32con
'''
Support :
chlocal 选择当前脚本所在目录
无参数
str2hex 将字符串转换为二进制
需要字符串参数
... |
lmps.py | # ******************************************************************************
# pysimm.lmps module
# ******************************************************************************
#
# ******************************************************************************
# License
# ******************************************... |
oldtest.py | '''
DISTRIBUTION STATEMENT A. Approved for public release: distribution unlimited.
This material is based upon work supported by the Assistant Secretary of Defense for
Research and Engineering under Air Force Contract No. FA8721-05-C-0002 and/or
FA8702-15-D-0001. Any opinions, findings, conclusions or recommendation... |
eventsmanager.py | import threading
from time import sleep
def singleton(cls):
instance = [None]
def wrapper(*args, **kwargs):
if instance[0] is None:
instance[0] = cls(*args, **kwargs)
return instance[0]
return wrapper
def sameFunction(f1, f2): #used for unsubscribing, remove all subscript... |
playlist.py | import json
import threading
import logging
import random
import time
import variables as var
from media.cache import (CachedItemWrapper, ItemNotCachedError,
get_cached_wrapper_from_dict, get_cached_wrapper_by_id)
from database import Condition
from media.item import ValidationFailedError, Pre... |
example_subscribe.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_subscribe.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api
# Documentation: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api
# PyPI: https://pypi.or... |
jobs.py | # Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import
import errno
from abc import abstractmethod
from collections import namedtuple
from threading import BoundedSemaphore, Event, Thread
from pex.compa... |
__init__.py | """
Create ssh executor system
"""
import base64
import binascii
import copy
import datetime
import getpass
import hashlib
import logging
import multiprocessing
import os
import re
import subprocess
import sys
import tarfile
import tempfile
import time
import uuid
import salt.client.ssh.shell
import salt.client.ssh.w... |
threadSimple.py | #!/usr/bin/python
# Simple threading program
import time
import threading
def printChars():
for x in range(0,10):
print x
def printLines():
for x in range(0,10):
print "Hello Thread!"
time.sleep(1)
t1 = threading.Thread(target = printChars)
t2 = threading.Thread(target = printLines)
t1.start()
t2.start(... |
app.py | # coding:utf-8
import os
import sys
from datetime import datetime
from inspect import ismethod
from threading import Thread
from time import sleep
from typing import Text
from werkzeug.datastructures import ImmutableDict
from ctpbee import __version__
from ctpbee.looper.data import VessData
from ctpbee.looper.report... |
lockmode_t.py | #
# Copyright 2013, Couchbase, 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 applicable l... |
test_insert.py | import copy
import logging
import threading
import pytest
from pymilvus import DataType, ParamError, BaseException
from utils import utils as ut
from common.constants import default_entity, default_entities, default_binary_entity, default_binary_entities, \
default_fields
from common.common_type import CaseLabel
... |
discord_bot.py | # Discord bot for deadman's switch
import discord # For discord bot interface
from discord.ext import commands
import hashlib # To hash inputted password and verify hashes
from time... |
__init__.py | """
m2wsgi: a mongrel2 => wsgi gateway and helper tools
====================================================
This module provides a WSGI gateway handler for the Mongrel2 webserver,
allowing easy deployment of python apps on Mongrel2. It provides full support
for chunked response encoding, streaming reads of large ... |
threads.py | # Copyright 2019 Uber Technologies, 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 applica... |
darknet_video.py | from ctypes import *
import random
import os
import cv2
import time
import darknet
import argparse
from threading import Thread, enumerate
from queue import Queue
from PIL import Image
import numpy as np
os.environ["CUDA_VISIBLE_DEVICES"] = "2"
frame_width = None
frame_width = None
def parser():
parser = argparse... |
common.py | """Test the helper method for writing tests."""
import asyncio
import collections
from collections import OrderedDict
from contextlib import contextmanager
from datetime import timedelta
import functools as ft
from io import StringIO
import json
import logging
import os
import sys
import threading
from unittest.mock im... |
memtest.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2015 Ben Kurtovic <ben.kurtovic@gmail.com>
#
# 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 ... |
localserver.py | import socket
import tqdm
import os
import time
import multiprocessing
import openpyxl
import threading
from openpyxl import Workbook
import openpyxl as xl;
import schedule
def recvr(h,p):
SERVER_HOST = h
SERVER_PORT = p
if p==5001:
pi=1
if p==5003:
pi=2
BUFFER_SIZE... |
database.py | from itertools import permutations
try:
from Queue import Queue
except ImportError:
from queue import Queue
import re
import threading
from peewee import *
from peewee import Database
from peewee import FIELD
from peewee import attrdict
from peewee import sort_models
from .base import BaseTestCase
from .base ... |
train_rfcn_fix_hard.py | #!/usr/bin/env python
# --------------------------------------------------------
# R-FCN
# Copyright (c) 2016 Yuwen Xiong, Haozhi Qi
# Licensed under The MIT License [see LICENSE for details]
# --------------------------------------------------------
"""Train a R-FCN network using alternating optimization.
This tool ... |
queue_poll.py | import time
from lithops.multiprocessing import Process, Queue, current_process
def f(q):
print("I'm process {}".format(current_process().pid))
q.put([42, None, 'hello'])
for i in range(3):
q.put('Message no. {} ({})'.format(i, time.time()))
time.sleep(1)
print('Done')
if __name__ =... |
renderer.py | """
Renders the command line on the console.
(Redraws parts of the input line that were changed.)
"""
from __future__ import unicode_literals
from prompt_toolkit.eventloop import Future, From, ensure_future, get_event_loop
from prompt_toolkit.filters import to_filter
from prompt_toolkit.formatted_text import to_format... |
main.py | # extended from https://github.com/WorldFamousElectronics/PulseSensor_Amped_Arduino
import time
import threading
import board
import busio
i2c = busio.I2C(board.SCL, board.SDA)
import adafruit_ads1x15.ads1015 as ADS
from adafruit_ads1x15.analog_in import AnalogIn
class Pulsesensor:
def __init__(self, channel =... |
server.py | import socket
import threading
from _thread import start_new_thread
username_password_db = {'srinag': 'password', 'shreyas': 'password', 'skitty': 'password', 'yash': '149',
'sanjay': '136'}
username_resolver = {}
ip_resolver = {}
username_conn = {}
call_service_port = 8001
msg_service_port = 8... |
runCTADataRecording.py | # encoding: UTF-8
import multiprocessing
from time import sleep
from datetime import datetime, time
from vnpy.event import EventEngine2
from vnpy.trader.vtEvent import EVENT_LOG
from vnpy.trader.vtEngine import MainEngine, LogEngine
from vnpy.trader.gateway import okexGateway
from vnpy.trader.app import dataRecorder
... |
pump.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 ... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... |
test_stdout.py | from __future__ import print_function
import os
import random
import string
import sys
import time
import pytest
from dagster import (
DagsterEventType,
InputDefinition,
ModeDefinition,
execute_pipeline,
pipeline,
reconstructable,
resource,
solid,
)
from dagster.core.execution.compute... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
test_concurrent_futures.py | import test.support
# Skip tests if _multiprocessing wasn't built.
test.support.import_module('_multiprocessing')
# Skip tests if sem_open implementation is broken.
test.support.import_module('multiprocessing.synchronize')
# import threading after _multiprocessing to raise a more revelant error
# message: "No module n... |
pulsesensor.py | # extended from https://github.com/WorldFamousElectronics/PulseSensor_Amped_Arduino
import time
import threading
from MCP3008 import MCP3008
class Pulsesensor:
def __init__(self, channel = 0, bus = 0, device = 0):
self.channel = channel
self.BPM = 0
self.adc = MCP3008(bus, device)
def... |
manual.py | #!/usr/bin/python
# -*- coding: UTF-8 -*-
# author:acloudtwei
# FileName:weisport-manual
# createdate:2022/02/23
# SoftWare: PyCharm
import weipyweb
from weipyweb.input import *
from weipyweb.output import *
import requests, time, re, random
import redis
from apscheduler.schedulers.blocking import BlockingScheduler
im... |
data_utils.py | """Utilities for file download and caching."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import hashlib
import multiprocessing as mp
import os
import random
import shutil
import sys
import tarfile
import threading
import time
import warnings
import zip... |
lisp-core.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... |
MathExpression.py | import operator
import numpy as np
import math
import re
import functools
from threading import Thread
def forceReversible(func):
"""Tries reversing the arguments of the two argument function func if the original raises a TypeError"""
@functools.wraps(func)
def wrapper(arg0, arg1):
print "Arg 0: %... |
main.py | # Copyright 2020 Google Research. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
HTMLInfo.py | import AMZPrice
import BBPrice
import JDPrice
import TMprice
import re
import requests
import sys
import threading
from selenium import webdriver
REFERER = ""
header = {
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) '
'Chrome/58.0.3029.110 Safari/537.36',
... |
pos.py | #!/usr/bin/env python3
# version 0.2.1-DEV
import os
import sys
import logging
import json
import psycopg2
import psycopg2.extras
from psycopg2.pool import ThreadedConnectionPool
from contextlib import contextmanager
import datetime
import argparse
import threading
from queue import Queue
import time
# flask
from fla... |
potc_gui_v_1.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'potc_analysis_gui.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
#import rospy
import math
import pandas as pd
im... |
contentconfigurationservice.py | #!/usr/bin/env python
'''A library and a command line tool to interact with the LOCKSS daemon's
content configuration service via its Web Services API.'''
__copyright__ = '''\
Copyright (c) 2000-2016, Board of Trustees of Leland Stanford Jr. University
All rights reserved.'''
__license__ = '''\
Redistribution and us... |
session_debug_testlib.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... |
migrate_taxon_tree.py | from datanator_query_python.config import motor_client_manager
import asyncio
import simplejson as json
from pymongo import UpdateOne
from pymongo.errors import BulkWriteError
from pprint import pprint
class MigrateTaxon:
def __init__(self, collection="taxon_tree", to_database="datanator-test",
... |
test.py | # import threading
#
# class hello:
# say_hello = False
#
# def poll(cls):
# import time
#
# while not cls.say_hello:
# pass
#
# time.sleep(.1)
# poll(cls)
#
# thd = threading.Thread(target=poll, args=(hello,))
#
# thd.start()
#
# import code
# code.interact(banner="", local=locals())
from ... |
pyshell.py | #! /usr/bin/env python3
import sys
try:
from tkinter import *
except ImportError:
print("** IDLE can't import Tkinter.\n"
"Your Python may not be configured for Tk. **", file=sys.__stderr__)
raise SystemExit(1)
# Valid arguments for the ...Awareness call below are defined in the following.
# ht... |
testsWebsite.py | import sys
import json
from http.client import HTTPConnection, HTTPException
from bs4 import BeautifulSoup
import requests
import os
from threading import Thread
from airankings import main
basedir = os.path.abspath(os.path.dirname(__file__))
venueSource = basedir + '/../app/static/ai_venues.json'
URL = ('localhos... |
test_subprocess.py | import unittest
from test import script_helper
from test import support
import subprocess
import sys
import signal
import io
import locale
import os
import errno
import tempfile
import time
import re
import sysconfig
import warnings
import select
import shutil
import gc
import textwrap
try:
import resource
except ... |
base_consumer.py | # -*- coding: utf-8 -*-
# @Author : ydf
# @Time : 2019/8/8 0008 13:11
"""
所有中间件类型消费者的抽象基类。使实现不同中间件的消费者尽可能代码少。
整个流程最难的都在这里面。因为要实现多种并发模型,和对函数施加20运行种控制方式,所以代码非常长。
"""
import typing
import abc
import copy
from pathlib import Path
# from multiprocessing import Process
import datetime
# noinspection PyUnresolvedReference... |
lztsReadTempMem.py | #!/usr/bin/env python3
#-----------------------------------------------------------------------------
# Title : ePix 100a board instance
#-----------------------------------------------------------------------------
# File : epix100aDAQ.py evolved from evalBoard.py
# Author : Ryan Herbst, rherbst@slac.st... |
bot_codeforces.py | import os
import os.path as pth
import re
import time
from threading import Thread
from selenium.webdriver.common.keys import Keys
from bot_cp import *
class bot_codeforces(bot_cp):
def prept(self, prob_code: str, autoload=False):
driver = get_driver()
contestname = self.contestname
dri... |
run_background_processes_no_daemons_sk.py | import multiprocessing
import time
def foo():
name = multiprocessing.current_process().name
print ("Starting %s \n" %name)
if name == 'bg_process':
for i in range(0,5):
print('---> %d \n' %i)
time.sleep(1)
else:
for i in range(5,10):
print('---> %d \n' %i... |
test_utils.py | ##############################################################################
# Copyright (c) 2015 Ericsson AB and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available... |
Client.py | #!/usr/bin/env python
# coding: utf-8
# In[9]:
from pymouse import PyMouse
from pykeyboard import PyKeyboard
import socket
import os
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
import pygame
import sys
import threading
from tkinter import *
from tkinter import filedialog
# In[ ]:
IP = [l for l in ([ip for ... |
test3.py | import easyquotation
from util import mysqlUtil
from time import strftime, localtime
quotation = easyquotation.use('sina') # 新浪 ['sina'] 腾讯 ['tencent', 'qq']
# 异步获取股票数组数据
def get_real_and_save(stockCodeList):
stockRealInfoList = quotation.get_stock_data(stockCodeList)
# 将数据插入到DB中
for stockRealInfo in sto... |
test_salesforce.py | import http.client
import threading
import time
import unittest
import urllib.error
import urllib.parse
import urllib.request
from unittest import mock
import responses
from cumulusci.oauth.salesforce import SalesforceOAuth2
from cumulusci.oauth.salesforce import CaptureSalesforceOAuth
class TestSalesforceOAuth(uni... |
evaluate.py | import time
import statistics
from timeit import default_timer as timer
from multiprocessing import Process, Queue
import os
import datetime
import subprocess
import queue
import energyusage.utils as utils
import energyusage.convert as convert
import energyusage.locate as locate
import energyusage.report as report
... |
test.py | #!/bin/env python3
import esockets
import threading
import socket
import time
import logging
import sys
from time import sleep
import maxthreads
root = logging.getLogger()
root.setLevel(logging.DEBUG)
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)... |
interface.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... |
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 refactor... |
test_util.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
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
Version_Code = 'v1.1.0' # 版本号
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(mess... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
parallel_to_sound.py | import os
from multiprocessing import Process, Queue
import lib.video as video
class Pool:
"""
A pool of video downloaders.
"""
def __init__(self, classes, source_directory, target_directory, num_workers, failed_save_file, no_sound_save_file):
self.classes = classes
self.source_directory = source_dir... |
plugin.py | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# --------------------------------------------------------------------------
import atexit
import gzip
import json
import os
import shutil
import sys
import tempfile
import threading
i... |
client.py | import socket
import threading
flag = 0
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
hostname = input("Enter your host :: ")
s.connect((hostname, 1023))
nickname = input("Enter your Name :: ")
def recieve():
while True:
try:
msg = s.recv(1024).decode("utf-8")
... |
rpc_test.py | import concurrent.futures
import contextlib
import json
import os
import sys
import threading
import time
from collections import namedtuple
from functools import partial
from threading import Event
from threading import Lock
from unittest import mock
import torch
import torch.nn as nn
import torch.distributed as dis... |
xla_client_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... |
network.py | """
Defines network nodes used within core.
"""
import logging
import os
import socket
import threading
import time
from socket import AF_INET, AF_INET6
from core import CoreCommandError, constants, utils
from core.emulator.data import LinkData
from core.emulator.enumerations import LinkTypes, NodeTypes, RegisterTlvs... |
test_gluon_model_zoo.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... |
appcontroller.py | import os
import sys
import re
import time
import json
import codecs
import os.path
import subprocess
import threading
from typing import Dict, List
from libtmux.pane import Pane
from libtmux.server import Server
from libtmux.window import Window
from vimgdb.base.common import Common
from vimgdb.base.controller impor... |
serve.py | """PostProcessor for serving reveal.js HTML slideshows."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import os
import webbrowser
import threading
from tornado import web, ioloop, httpserver, log, gen
from tornado.httpcl... |
test_container.py | # global
import os
import queue
import pytest
import random
import numpy as np
import multiprocessing
import pickle
# local
import ivy
from ivy.container import Container
import ivy_tests.test_ivy.helpers as helpers
def test_container_list_join(device, call):
container_0 = Container(
{
"a": [... |
SeqAnalysis2.py | """
The MIT License (MIT)
Copyright (c) 2017 Paul Yoder, Joshua Wade, Kenneth Bailey, Mena Sargios, Joseph Hull, Loraina Lampley
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.