source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
test_io.py | import sys
import gzip
import os
import threading
import time
import warnings
import io
import re
import pytest
from tempfile import NamedTemporaryFile
from io import BytesIO, StringIO
from datetime import datetime
import locale
import numpy as np
import numpy.ma as ma
from numpy.lib._iotools import ConverterError, Co... |
webcam.py | #!/usr/bin/python3
#
# Copyright (C) 2020 P.L. Lucas
#
#
# LICENSE: BSD
# You may use this file under the terms of the BSD license as follows:
#
# "Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions ... |
dvtmstatus.py | from threading import Thread
import sys
class Writer:
def __init__(self, parent):
self.value = ''
self.parent = parent
def write(self, value):
self.value = value
self.parent.write()
def __str__(self):
return str(self.value)
class StatusBar:
def __init__(sel... |
dataengine-service_configure.py | #!/usr/bin/python3
# *****************************************************************************
#
# 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 ... |
bot.py | #!/usr/bin/env python
import sys, os, re, threading, imp
import irc
home = os.getcwd()
def decode(bytes):
try: text = bytes.decode('utf-8')
except UnicodeDecodeError:
try: text = bytes.decode('iso-8859-1')
except UnicodeDecodeError:
text = bytes.decode('cp1252')
return text
class Ph... |
httptest.py | #!/usr/bin/env python3
'''
httptest offers the Handler for serving test data and the HTTPServer
which is started and stopped using the httptest.Server() decorator.
'''
import os
import io
import json
import hashlib
import inspect
import selectors
import threading
import http.server
import urllib.request
import multipro... |
mul_questiion.py | import threading
count = 0
def count_fun():
global count
for _ in range(1000000):
count += 1
threading_list = []
t1 = threading.Thread(target=count_fun)
t2 = threading.Thread(target=count_fun)
threading_list.append(t1)
threading_list.append(t2)
list(map(lambda x: x.start(), threading_list))
list(... |
test_dag_serialization.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... |
worker_test.py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... |
network.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... |
plot.py | import multiprocessing as mp
from copy import copy
import numpy as np
import tkinter
import pickle
import os
from itertools import accumulate
from matplotlib import pyplot as plt, lines
from casadi import Callback, nlpsol_out, nlpsol_n_out, Sparsity
from ..misc.data import Data
from ..misc.enums import PlotType, Cont... |
throttler.py | # Copyright European Organization for Nuclear Research (CERN)
#
# 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.0OA
#
# Authors:
# - Vincent Garonne, ... |
mainwindow.py | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Spyder, the Scientific PYthon Development EnviRonment
=====================================================
Developped and maintained by the Spyder Pro... |
parallel.py | import threading
from time import sleep
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
from bioprocs.utils.shell2 import runcmd
from traceback import format_exc
from queue import Queue
def distribute(total, nthread):
"""
Try to distribute jobs into N threads as equal as possible.
For example... |
common.py | import itertools
from uuid import uuid4
from collections import defaultdict, Counter
from multiprocessing import Process, Queue, Event, RLock
from threading import Thread
from itertools import product
try:
from Queue import Empty as QueueEmptyException
except ImportError:
from queue import Empty as QueueEmptyE... |
consoleObama.py | import time
import ueberzug.lib.v0 as ueberzug
from pynput import keyboard
import os
os.system("color")
from termcolor import colored
from slowprint.slowprint import *
slowprint(colored("Made by Bira ❤️ ","magenta",attrs=['reverse','bold']),0.4)
import threading
demo = ""
moving_w = 0
moving_a = 0
moving_s = 0
moving_d... |
Hiwin_RT605_ArmCommand_Socket_20190627195308.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... |
test_socket.py | import unittest
from test import support
import errno
import io
import itertools
import socket
import select
import tempfile
import time
import traceback
import queue
import sys
import os
import array
import contextlib
from weakref import proxy
import signal
import math
import pickle
import struct
import random
import... |
interface.py | from tkinter import *
from tkinter import messagebox
from tkinter import ttk
import os
import numpy as np
import threading
cprocess = np.array([False,False,False,False])
processMap = ["Scraping ImSorryJon", "Scraping Garfield Strips", "Loading Scraped Data","Training the Network"]
import queue
def trainModel():
tdi... |
web.py | # coding=utf-8
import sys
import os
import threading
import getopt
import queue
import json
import logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - [%(levelname)s] - %(name)s - %(message)s')
# http 请求模块
import requests
from flask import Flask
from flask import request
sys.path.... |
agents.py | #!/usr/bin/python
# vim:fileencoding=utf-8
import sys, time, threading
from sensors import Buttons
from actuators import StepMotorPair, Leds, Buzzer
class Agent:
def __init__(self):
self.state = "init"
self.motors = StepMotorPair()
self.buttons = Buttons()
self.buzzer = Buzzer()
self.leds = Leds()
self.ca... |
pika_async_rpc_example.py | """
This is a simple example on how to use Flask and Asynchronous RPC calls.
I kept this simple, but if you want to use this properly you will need
to expand the concept.
Things that are not included in this example.
- Reconnection strategy.
- Closing or re-opening the connection.
- Keep in mind that... |
stats_poller.py | import os
import re
import sys
import time
import yaml
import socket
import logging
import urllib2
import rrdtool
import argparse
import multiprocessing as mp
from scalrpy.util import rpc
from scalrpy.util import helper
from scalrpy.util import dbmanager
from scalrpy.util import cryptotool
from scalrpy.util import bas... |
multitester.py | """
Letsencrypt Integration Test Tool
- Configures (canned) boulder server
- Launches EC2 instances with a given list of AMIs for different distros
- Copies letsencrypt repo and puts it on the instances
- Runs letsencrypt tests (bash scripts) on all of these
- Logs execution and success/fail for debugging
Notes:
- ... |
run.py | # HELP:
# Run karonte on a set of firmware sample and store the results in ./eval/karonte_stats/results/<vendor>
import os
import sys
import subprocess as sp
from optparse import OptionParser
from optparse import Option, OptionValueError
import threading
import time
RESULTS = './eval/karonte_stats/results/'
class M... |
controller.py | import atexit
import functools
import inspect
import json
import os
import re
from copy import copy, deepcopy
from datetime import datetime
from logging import getLogger
from multiprocessing import Process, Queue
from threading import Thread, Event, RLock
from time import time
from typing import Sequence, Optional, Map... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import asyncio
from typing import TYPE_CHECKING, Optional, Union, Callable, Sequence
from electrum_onion.storage import WalletStorage, StorageReadWriteError
from electrum_onion.wallet_db import Wall... |
sigmatcp.py | '''
Copyright (c) 2018 Modul 9/HiFiBerry
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribu... |
lobbyscreen.py | from json.decoder import JSONDecodeError
import time
import requests
import threading
import pyperclip
import subprocess
from functools import partial
from config import *
from kivy.properties import ObjectProperty
from kivy.uix.screenmanager import Screen
from ui.modals import *
from ui.buttons import DummyBtn, Player... |
main.py | from __future__ import annotations
import _thread
import os
import re
from datetime import datetime, timedelta
import PySimpleGUIQt as sg
import asyncio
import threading
import sys
import brightness_control
import volume_control
import audio_listener
from serialization import *
from calibration import *
from logger ... |
run.py | """run.py"""
#!/usr/bin/env python3
import os
import torch
import torch.distributed as dist
from torch.multiprocessing import Process
# blocking
def run_blocking(rank, size):
""" Blocking point-2-point communication """
tensor = torch.zeros(1)
if rank == 0:
tensor += 1
# Send the tensor to ... |
test_shortcut_sync_http.py | """
The MIT License (MIT)
Copyright (c) 2015 kelsoncm
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, pub... |
controller.py | #!/usr/bin/env python2
# Copyright 2018-present University of Tuebingen, Chair of Communication Networks
#
# 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/... |
redfishMockupServer.py | # Copyright Notice:
# Copyright 2016-2019 DMTF. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/Redfish-Mockup-Server/blob/master/LICENSE.md
# redfishMockupServer.py
# tested and developed Python 3.4
import sys
import argparse
import time
import collections
import... |
websocket_server.py | #!/usr/bin/env python
import asyncio
import json
import queue
import threading
import numpy as np
import websockets
from club_controller import app_config
from club_controller.clients.client_udp_listener import ClientUDPListener
from club_controller.clients.led_strip_mode_id import LedStripModeId
from club_controller.... |
update.py | import os
from os.path import dirname, join
import sys
from time import time
import threading
# ensure registry is set up on Windows before we start
from config import appname, appversion, update_feed, update_interval, config
if not getattr(sys, 'frozen', False):
# quick and dirty version comparison assuming "s... |
PayInvoiceThread.py | import boto3
from CommonThread import CommonThread
import json
from botocore.client import Config
from lnd import Client
from threading import Thread
class PayInvoiceThread(CommonThread):
def __init__(self, lnddatadir):
super().__init__('PIThread', 'PayInvoiceThread')
config = Config(
r... |
netattack.py | #!/usr/bin/env python
import sys
import os
import time
import argparse
from threading import Thread
import logging
logging.getLogger('scapy.runtime').setLevel(logging.ERROR)
from scapy.all import *
conf.verb = 0
W = '\033[0m' # white (normal)
R = '\033[31m' # red
G = '\033[32m' # green
O = '\033[33m' # orange
P ... |
node.py | import block
import wallet
import constants
import blockchain
import requests
import transaction
from Crypto.Hash import SHA
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
import binascii
import json
import threading
from time import sleep
class node:
def __init__(self, myIp, myPort, i... |
reminder.py | import os
import requests
from datetime import datetime
from dateutil.parser import parse
from dateutil import tz
from pytz import timezone
from threading import Thread
from overlord import celery
from utils import Event, Email, headers
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMET... |
genomeScaffolding.py | import subprocess, os, sys
from collections import defaultdict, OrderedDict
import numpy as np
from multiprocessing import Pool, Queue, Process
from threading import Thread
import subprocess,shutil
from pybedtools import BedTool
from jcvi.formats import gff
from pyfaidx import Fasta
import time
"""python genomeScaffo... |
seleniumBasic.py | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
import time
from sys import platform
from multiprocessing import Process, Queue
import traceback
import logging
import numpy as np
import random
unpackedExtensionPath = "../src"
if pla... |
DarkPremium.py | # -*- coding: utf-8 -*-
import os, sys, time, datetime, random, hashlib, re, threading, json, getpass, urllib, requests, mechanize
from multiprocessing.pool import ThreadPool
try:
import mechanize
except ImportError:
os.system('pip2 install mechanize')
else:
try:
import requests
except ImportEr... |
prepareDataset.py | import math, shutil, os, time, argparse, json, re, sys
import numpy as np
import scipy.io as sio
from PIL import Image
import multiprocessing
from multiprocessing import Queue
from operator import itemgetter
import pprint as pp
'''
Prepares the GazeCapture dataset for use with the pytorch code. Crops images, compiles ... |
pump_sfd.py | #!/usr/bin/env python3
import glob
import json
import logging
import os
import queue
import re
import struct
import threading
from collections import defaultdict
from typing import Any, Dict, List, Optional, Tuple
import couchstore # pylint: disable=import-error
import couchbaseConstants
import pump
from cb_bin_cli... |
penv.py | from multiprocessing import Process, Pipe
import gym
def worker(conn, env): # this function works on remote; it uses remote.recv() to receives commands to execute.
while True: # local sends these commands. remote is the remote worker thread.
cmd, data = conn.recv()
if cmd == "step":
obs... |
control_panel.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'control.ui'
#
# Created by: PyQt5 UI code generator 5.10.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
import rospy
from geometry_msgs.msg import Twist
from std_... |
event.py | #!/usr/bin/env python
from threading import Thread
import subprocess
from Queue import Queue
import time
num_threads = 3
queue = Queue()
ips = ["10.0.1.1", "10.0.1.3", "10.0.1.11", "10.0.1.51"]
def pinger(i, q):
"""Pings subnet"""
while True:
ip = q.get()
print "Thread %s: Pinging %s" % (i, ip... |
main.py | import threading, signal, logging, shlex, traceback
from singstarmic.discoveryserver import DiscoveryServer
from singstarmic.appserver import AppServer
from singstarmic.catalogueserver import CatalogueServer
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(__name__)
class MicServer:
is_running = False... |
keyboard.py | """Support for keyboard interaction.
Python has only little support for direct keyboard interactions. Most
functions are operating system dependent or provided by third party
libraries (like `getch`). The main goal of this module is to provide
a uniform API that can be used to detect individual keystrokes.
"""
# s... |
util.py | #
# Copyright (C) 2012-2017 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import codecs
from collections import deque
import contextlib
import csv
from glob import iglob as std_iglob
import io
import json
import logging
import os
import py_compile
import re
import socket
try:
import ssl
... |
test_rwlock.py | from threading import Thread, current_thread
from time import sleep
from unittest import TestCase
from pyff.locks import ReadWriteLock
class TestReadWriteLock(TestCase):
def setUp(self):
self.lock = ReadWriteLock()
self.readers = 0
self.writer_active = False
self.exceptions = dict... |
client.py | import collections
from multiprocessing import Process, Queue
import urllib
import requests
from bos_consensus.common import Message
from bos_consensus.util import logger
MessageInfo = collections.namedtuple(
'MessageInfo',
('ip', 'port', 'message'),
)
def send_message(message_info):
assert isinstance... |
test_closing.py | from fixtures import * # noqa: F401,F403
from lightning import RpcError
from utils import only_one, sync_blockheight, wait_for, DEVELOPER, TIMEOUT, VALGRIND, SLOW_MACHINE
import queue
import pytest
import re
import threading
import unittest
@unittest.skipIf(not DEVELOPER, "Too slow without --dev-bitcoind-poll")
de... |
test_cli22.py | import json
import multiprocessing
import os
from os import system, path
import re
from urllib.request import urlopen
from sys import stdout, argv, exit
from PyQt5 import QtCore
import time,subprocess as sp
from datetime import datetime
import ctypes
class Phishing_cli():
def __init__(self):
if "nt" in os.... |
ISSMDAVFileHandler.py | from datetime import *
import tempfile
import time
import threading
import os
class ISSMDAVFileHandler():
def __init__(self):
self.tempfile_list = {}
print("----------------------------------------------------")
t1 = threading.Thread(target = self.init_cache_watcher, args=())
t1.sta... |
train.py | # Create by Packetsss
# Personal use is allowed
# Commercial use is prohibited
"""
@author: Viet Nguyen <nhviet1009@gmail.com>
"""
import os
os.environ['OMP_NUM_THREADS'] = '1'
import argparse
import torch
from src.env import create_train_env
from src.model import ActorCritic
from src.optimizer import GlobalAdam
from... |
CurvesView.py | # coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2017 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
#... |
log.py | #!/usr/bin/env python
"""
Copyright (c) 2020 NIDDS developers (https://github.com/prasanthc41m/nidds/)
See the file 'LICENSE' for copying permission
"""
from __future__ import print_function
import datetime
import os
import re
import signal
import socket
import sys
import threading
import time
import traceback
from ... |
email.py | from flask_mail import Message
from app import app,mail
from flask import render_template
from threading import Thread
from flask_babel import _
# def send_mail(subject, sender, recipients, text_body, html_body):
# msg = Message(subject, sender=sender, recipients=recipients)
# msg.body = text_body
# msg.h... |
wsdump.py | #!/Users/mgallagher/copycatbot/bin/python
import argparse
import code
import sys
import threading
import time
import ssl
import six
from six.moves.urllib.parse import urlparse
import websocket
try:
import readline
except ImportError:
pass
def get_encoding():
encoding = getattr(sys.stdin, "encoding", "... |
SelectAngle_Serial1121 - udp.py | # encoding=utf-8
import socket # 引入套接字
import threading # 引入并行
import pymysql
import struct
import serial
import matplotlib.pyplot as plt
import datetime
import math
import sys,os
sys.path.append(r'D:\OneDrive\Python_project\Github\AntiUAV_Python\Python')
# from DBInfo import *
plt.ion() # 开启一个画图的窗口
ax1 = [] # 定义... |
TargetExtractor.py | import sm
import numpy as np
import sys
import multiprocessing
import queue
import time
import copy
import cv2
def multicoreExtractionWrapper(detector, taskq, resultq, clearImages, noTransformation):
while 1:
try:
task = taskq.get_nowait()
except queue.Empty:
return
... |
pydev.py | #! /bin/env python
# encoding=utf-8
# gusimiu@baidu.com
# datemark: 20150428
#
# V1.6:
# add TempStorage.
#
# V1.5:
# add png_to_array
#
# V1.4:
# add zip_channel, index_to_one_hot
#
# V1.3:
# add DimAnalysis
#
# V1.2:
# add FileProgress
#
# V1.1:
# add MailSender an... |
model.py | from __future__ import absolute_import
from __future__ import division
import os
import math
import json
import threading
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
import h5py
import random
import util
import coref_ops
import metrics
class VisCoref(object):
def __init__(self, config):... |
graph_toffset_bpm_inc.py | import pyqtgraph
from pyqtgraph.Qt import QtCore, QtGui
import numpy as np
import threading
from osu_analysis import StdScoreData
from app.data_recording.data import RecData
class GraphTOffsetBPMInc(QtGui.QWidget):
__calc_data_event = QtCore.pyqtSignal(object, object)
def __init__(self, parent=None):
... |
annotation_ontology_apiServer.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... |
aggregator.py | #!/usr/bin/env python
"""
Copyright (c) 2015-2018 The University of Tennessee and The University
of Tennessee Research Foundation. All rights
reserved."
This python script is the main script for the aggregator application.
@author Damien Genet
@email parsec-users@icl.... |
holideck.py | #!/usr/bin/python
#
"""
Holideck - Simulation and development enviornment for Holiday by MooresCloud
Homepage and documentation: http://dev.moorescloud.com/
Copyright (c) 2013, Mark Pesce.
License: MIT (see LICENSE for details)
"""
__author__ = 'Mark Pesce'
__version__ = '0.01-dev'
__license__ = 'MIT'
import sys, t... |
generate_breakpad_symbols.py | #!/usr/bin/env python
# Copyright (c) 2013 GitHub, Inc.
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A tool to generate symbols for a binary suitable for breakpad.
Currently, the tool only suppo... |
brain.py | from random import randint
import random
from Levenshtein import distance
from os import listdir
import json
from threading import Thread
from time import sleep
import re
# Import interface for basic convo file
from utils import convo_reader
from message_statistics import MessageStats
from utils import sentiment
from u... |
app.py | import os
import logging
from queue import Queue
from threading import Thread, Timer
import requests
from flask import Flask, request
from telegram import ReplyKeyboardMarkup, InlineKeyboardMarkup, InlineKeyboardButton, Bot, Update
from telegram.ext import CommandHandler, MessageHandler, Filters, Dispatcher
import pygs... |
repository.py | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import
import functools
import logging
import os
import re
import shutil
import subprocess
from argparse import ArgumentParser, _SubParsersAction
from cont... |
with_multithreading.py | from threading import Event, Thread
from time import sleep
import six.moves.queue as queue
from quantdsl.application.base import QuantDslApplication
from quantdsl.domain.model.contract_valuation import ContractValuation
from quantdsl.exceptions import TimeoutError, DslCompareArgsError, DslBinOpArgsError, DslIfTestExp... |
exportservice.py | #!/usr/bin/env python3
'''A library and a command line tool to interact with the LOCKSS daemon export
service via its Web Services API.'''
__copyright__ = '''\
Copyright (c) 2000-2021, Board of Trustees of Leland Stanford Jr. University,
all rights reserved.
'''
__license__ = '''\
Redistribution and use in source an... |
tacker_agent.py | #!/usr/bin/env python
import json
import time
import yaml
import logging
from queue import Queue
from threading import Thread
from multiprocessing.pool import Pool
from exceptions import NFVOAgentsException, NFVOAgentOptions, VIMAgentsException
from nfvo_agents import NFVOAgents
from interface import implements
fro... |
DisplayNodeProxy.py |
# Display Node - Python and Javascript plotting and data visualisation.
# Stefano Pedemonte
# Aalto University, School of Science, Helsinki
# 20 Oct 2013, Helsinki
from DisplayNodeServer import DisplayNodeServer
from DisplayNodeServer import PROXY_ADDRESS,PROXY_PORT,WEB_ADDRESS,WEB_PORT
from xmlrpclib import Ser... |
pydoc.py | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide online
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
Run "pydo... |
ensembles_base.py | import warnings
from abc import abstractmethod, ABC
from functools import partial
from itertools import repeat
from multiprocessing import Process, Queue
from multiprocessing.pool import ThreadPool, Pool
from queue import PriorityQueue
from threading import Thread
import numpy as np
import pandas as pd
import scipy.st... |
manager.py | #!/usr/bin/env python3
import datetime
import importlib
import os
import sys
import fcntl
import errno
import signal
import shutil
import subprocess
import textwrap
import time
import traceback
from multiprocessing import Process
from typing import Dict
from common.basedir import BASEDIR
from common.spinner import Sp... |
word2vec_optimized.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... |
pytest_dut_monitor.py | import pytest
import paramiko
import threading
import logging
import time
import os
import yaml
from collections import OrderedDict
from datetime import datetime
from errors import HDDThresholdExceeded, RAMThresholdExceeded, CPUThresholdExceeded
logger = logging.getLogger(__name__)
DUT_MONITOR = "/tmp/dut_monitor.p... |
presenter_socket_server.py | # =======================================================================
#
# Copyright (C) 2018, Hisilicon Technologies Co., Ltd. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1 Redistrib... |
feature_extract.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2019 Wu Yi-Chiao (Nagoya University)
# based on a WaveNet script by Tomoki Hayashi (Nagoya University)
# (https://github.com/kan-bayashi/PytorchWaveNetVocoder)
# based on sprocket-vc script by Kazuhiro Kobayashi (Nagoya University)
# (https://github.com/k2koba... |
task.py | from __future__ import print_function
import logging
import pprint
import traceback
import multiprocessing
import threading
import six
from multiprocessing.managers import SyncManager
from datetime import datetime
try:
from Queue import Empty
except ImportError:
from queue import Empty
from glycan_profiling.v... |
build_environment.py | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""
This module contains all routines related to setting up the package
build environment. All of this is set up by packa... |
lock_tests.py | import sys
import time
import asyncio
import unittest
import traceback
import aioprocessing
import aioprocessing.mp as multiprocessing
from aioprocessing.mp import Process, Event, Queue, get_all_start_methods
try:
from aioprocessing.mp import get_context
except ImportError:
def get_context(param):
pa... |
04.py | import time
import threading
def test():
time.sleep(5)
for i in range(1, 10):
print(i)
thread1 = threading.Thread(target=test)
thread1.start()
thread1.join()
print('主线程完成了')
|
test_replica_set_connection.py | # Copyright 2011-2012 10gen, 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,... |
bruter.py | # Date: 12/28/2018
# Author: Mohamed
# Description: Bruter
import queue
import time
import threading
import typing
from lib.browser import Browser
from lib.display import Display
from lib.proxy_manager import ProxyManager
from lib.password_manager import PasswordManager
from lib.const import max_time_to_wa... |
__init__.py | import ast
import datetime
import json
import time
import threading
import socket
import paho.mqtt.client as mqtt
from flask import Flask
from flask import request
from kafka import KafkaProducer
from message.mqtt_message import MqttMessages
from .healthcheck import HealthCheck
from .actuator import Actuator
from .ht... |
api.py | from future.utils import with_metaclass
from multiprocessing.pool import ThreadPool
import datetime
from collections import OrderedDict
import pandas as pd
import numpy as np
import abc, argparse, json, os, ray, logging
import threading, time, subprocess, copy, sys, signal
from uptune.src.template import JinjaParser
... |
helper.py | import os
import platform
import subprocess
import time
from collections import OrderedDict, defaultdict
from functools import wraps
from itertools import chain, combinations
from re import ASCII, MULTILINE, findall, match
from threading import Thread
from typing import (
Any, Callable, DefaultDict, Dict, FrozenSet... |
dump_reader_multipart.py | # Copyright (C) 2013 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 ... |
backend.py | #SPDX-License-Identifier: MIT
"""
Augur library commands for controlling the backend components
"""
from copy import deepcopy
import os, time, atexit, subprocess, click, atexit, logging, sys
import psutil
import signal
import multiprocessing as mp
import gunicorn.app.base
from gunicorn.arbiter import Arbiter
from aug... |
Communicate.py | import socket
from collections import deque
from threading import Thread, Event
# TODO - fix how the connection closes.
class Communicate(object):
def __init__(self):
self.address = ""
self.port = 5580
self.finished = False
self.inbox = deque()
self.connection = socket.... |
api.py | """Defines the Python API for interacting with the StreamDeck Configuration UI"""
import json
import os
import threading
from functools import partial
from subprocess import Popen # nosec - Need to allow users to specify arbitrary commands
from typing import Dict, List, Tuple, Union
from warnings import warn
from PIL... |
tpu_estimator.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... |
mp.py | from __future__ import absolute_import, division, print_function, unicode_literals
from six.moves import zip, map, range
import os
import sys
import json
import traceback
from copy import deepcopy
from multiprocessing import Process
from subprocess import check_call, call, CalledProcessError
import mead
from baseline.... |
getch.py | class _Getch:
"""Gets a single character from standard input. Does not echo to the screen."""
def __init__(self):
try:
self.impl = _GetchWindows()
except ImportError:
self.impl = _GetchUnix()
def __call__(self):
return self.impl()
class _GetchUnix:
def... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.