source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
Chap10_Example10.19.py | from threading import Thread
daemonchk = False
def disp():
if daemonchk:
print('Display function only if it is daemon thread')
else:
print("Non-daemon thread")
threadobj = Thread(target = disp)
print("Before setting thread as daemon: ", threadobj.daemon)
threadobj.daemon = True
if th... |
tf_launch_server.py | import os
import tensorflow as tf
import multiprocessing
import signal
import json
import argparse
def pop_env():
for k in ['https_proxy', 'http_proxy']:
if k in os.environ:
os.environ.pop(k)
os.environ['CUDA_VISIBLE_DEVICES'] = ''
pop_env()
def start_server(cluster, task_id):
serv... |
misc_utils.py | # -*- coding: utf-8 -*-
"""
Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix)
Copyright (C) 2018 Caphm (original implementation module)
Miscellaneous utility functions
SPDX-License-Identifier: MIT
See LICENSES/MIT.md for more information.
"""
from __future__ import absolute_import, divisi... |
utils.py | ########
# Copyright (c) 2018-2020 GigaSpaces Technologies Ltd. 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
#
# U... |
misc.py | import importlib
import threading
import requests
from discord_interactions import verify_key_decorator
from flask import Blueprint, abort, send_file, request, jsonify
from globals import tokens, running_interactions, client
from statics import config
views = Blueprint("misc", __name__)
@views.route("/pictures/<gui... |
GUI.py | from tkinter import *
from tkinter.ttk import Progressbar
from tkinter import filedialog
from tkinter.messagebox import showerror , showinfo
from PIL import Image , ImageTk
from urllib.request import urlopen
from io import BytesIO
from Video import Video
import os
from threading import Thread
"""Creatin... |
USO_v3_station_b_M300_Pool_magmax.py | from opentrons.types import Point
import json
import os
import math
import threading
from time import sleep
metadata = {
'protocolName': 'USO_v3_station_b_M300_Pool_magmax',
'author': 'Nick <ndiehl@opentrons.com',
'apiLevel': '2.3'
}
NUM_SAMPLES = 28 # start with 8 samples, slowly increase to 48, then 94... |
app.py | # built-in imports
import time
import random
import queue
import threading
import webbrowser
# pip-installed imports
import socketio
import eventlet
eventlet.monkey_patch()
# create SocketIO Server and WSGI App
sio = socketio.Server()
app = socketio.WSGIApp(sio, static_files={
'/': './public/'
})
def task(sid):
... |
msg_dispatcher.py | # Copyright (c) Microsoft Corporation.
# Copyright (c) Tsinghua University.
# Copyright (c) Peng Cheng Laboratory.
# Licensed under the MIT license.
import logging
from collections import defaultdict
import json_tricks
from nni import NoMoreTrialError
from .protocol import CommandType, send
from .msg_dispatcher_base ... |
app.py | import json
import os
import threading
from dotenv import load_dotenv
from linepy import (LINE, Channel, OEPoll, OpType)
# Auth
load_dotenv()
try:
if (id_ := os.getenv("EMAIL_ID")) and (pwd := os.getenv("PASSWORD")):
client = LINE(id_, pwd)
elif token := os.getenv("TOKEN"):
client = LINE(idOrAu... |
Logger.py | """
#!/usr/bin/python3
# This file attempts to listen in on the communications of the MIL Bus and log activity in a .json file
# This file is a WORK IN PROGRESS
# TODO: Replace example event with actual code that gets an event from the simulator CORRECTLY
import socket
import threading
import json
import time
import ... |
kaldi_io_py.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2014-2016 Brno University of Technology (author: Karel Vesely)
# Licensed under the Apache License, Version 2.0 (the "License")
import numpy as np
import sys, os, re, gzip, struct
#################################################
# Adding kaldi tools to shel... |
tests.py | #! /usr/bin/env python3
import http.server
import os
import shutil
import socket
import subprocess
import tempfile
import threading
import unittest
class WrapperScriptTests(unittest.TestCase):
http_port = 8080
default_download_url = "http://localhost:" + str(http_port) + "/test/testapp.jar"
def setUp(se... |
test_closing.py | from fixtures import * # noqa: F401,F403
from flaky import flaky
from pyln.client import RpcError, Millisatoshi
from shutil import copyfile
from pyln.testing.utils import SLOW_MACHINE
from utils import (
only_one, sync_blockheight, wait_for, TIMEOUT,
account_balance, first_channel_id, closing_fee, TEST_NETWORK... |
wifi_shield_emulator.py | import json
import logging
import socket
import subprocess
import sys
import threading
import time
from http.server import HTTPServer, BaseHTTPRequestHandler
from random import randint
from brainflow_emulator.emulate_common import log_multilines, TestFailureError
class ShieldWriter(threading.Thread):
def __init... |
processmanager.py | import logging
import multiprocessing as mp
import psutil
from application.utils.helpers import what_time_is_it
from application.mongo import Connection
class ProcessManager(object):
@staticmethod
def get_single_process(pid):
"""
Get a Single Process given the PID
:param pid: Process... |
test_many_instances.py | #!/usr/bin/env python3
from multiprocessing import Process
from random import choice
import vizdoom as vzd
from argparse import ArgumentParser
DEFAULT_CONFIG = "../../scenarios/basic.cfg"
def play(process, instances, config_file):
games = []
for i in range(instances):
game = vzd.DoomGame()
... |
worker.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import atexit
import collections
import colorama
import copy
import hashlib
import inspect
import json
import numpy as np
import os
import redis
import signal
import sys
import threading
import time
import trac... |
autologin2.py | import time
import pythoncom
from manuallogin import *
from PyQt5 import QtWidgets
from PyQt5.QtCore import QTimer
from multiprocessing import Process
from PyQt5.QAxContainer import QAxWidget
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
from utility.setting import OPENAPI_PATH
class Wi... |
conftest.py | import sys
import threading
from functools import wraps, partial
from http.server import SimpleHTTPRequestHandler
import pytest
import torch.multiprocessing as mp
def pytest_configure(config):
config.addinivalue_line("markers", "spawn: spawn test in a separate process using torch.multiprocessing.spawn")
@pytes... |
test_faster_fifo.py | import logging
import multiprocessing
from queue import Full, Empty
from unittest import TestCase
from faster_fifo import Queue
import faster_fifo_reduction
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
log = logging.getLogger('rl')
log.setLevel(logging.DEBUG)
log.handlers = [] # No duplicated handlers
l... |
main.py | """Ngenix test task.
(C) 2021 by Vitaly Bogomolov mail@vitaly-bogomolov.ru
"""
from threading import Thread
from random import randint
from zipfile import ZipFile
from xml.sax import ContentHandler, parseString
from csv import writer
try:
from queue import Queue
except ImportError:
from Queue import Queue # ... |
Http.py | import http.server
import socketserver
import threading
import blng.LogHandler as LogHandler
class HttpHandler(http.server.SimpleHTTPRequestHandler):
pass
class Http:
HTTP_PORT = 4998
HTTP_ADDRESS = "0.0.0.0"
def __init__(self, http_port=0, log_component=''):
self.log = LogHandler.LogHandl... |
test_bmuf.py | import argparse
import random
import unittest
from multiprocessing import Manager
import torch
import torch.nn as nn
from fairseq import distributed_utils, optim
class Model(nn.Module):
def __init__(self, input_size, output_size):
super(Model, self).__init__()
self.fc = nn.Linear(inp... |
coro.py | '''
Async/Coroutine related utilities.
'''
import queue
import asyncio
import inspect
import logging
import functools
import multiprocessing
logger = logging.getLogger(__name__)
import synapse.exc as s_exc
import synapse.glob as s_glob
def iscoro(item):
return inspect.iscoroutine(item)
async def agen(item):
... |
emails.py | # from threading import Thread
#
# from flask import current_app, render_template
# from flask_mail import Message
#
# from blog.extensions import mail
#
#
# def _send_async_mail(app, message):
# with app.app_context():
# mail.send(message)
#
#
# def send_mail(to, subject, template, **kwargs):
# message... |
foto-tespit.py | import cv2
import numpy as np
import win32gui, win32ui, win32con, win32api
import time
import pyautogui
import tensorflow as tf
import threading
from object_detection.utils import ops as utils_ops
from object_detection.utils import label_map_util
class ekranlar:
def __init__(self):
self.screen ... |
MQTTTransport.py | import paho.mqtt.client as mqtt
import sys
import threading
from .autogen.messages import Frame_pb2 as FramePb
class MQTTTransport():
address = ('', 0)
def __init__(self):
self.client = mqtt.Client()
self.client.on_connect = self._on_connect
self.client.on_message = self._on_mess... |
ewelink_client.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
N Waterton 11th Jan 2019 V1.0 First release
'''
'''
Client class for connecting to iTEAD ewelink devices.
uses Itead's IoTgo framework see https://github.com/itead/IoTgo for more details
see http://www.pgeorgiev.com/how-do-sonoff-devices-work/ for a full explanation ... |
drop_stale_gradient_optimizer_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... |
server.py | #!/usr/bin/env python3
import bottle
import yaml
import json
import os
import platform
import time
from multiprocessing import Process
import database
__version__ = '0.0.2'
if platform.system().upper() == 'WINDOWS':
try:
import win32gui # NOQA
import win32con # NOQA
print('# Windows de... |
bandcampdownloader.py | import requests
import bs4
import eyed3
import json
import argparse
from pathlib import Path
from pydub import AudioSegment
from io import BytesIO
from multiprocessing import Process
def download(link, album_dir, wav=False, metadata=True):
album_dir = Path(album_dir)
album_dir.mkdir(parents=True,... |
wlin_server.py | import socket
import threading
import json
class WLinServer:
def __init__(self):
print('서버 준비완료')
self.sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sk.bind(('0.0.0.0', 45770))
self.sk.listen(10)
self._t = threading.Thread(target=self.server_listener)
... |
host_state.py | """
Global shared state about the host.
"""
import sys
import threading
import time
import utils
CLIENT_VERSION = '1.0.3'
class HostState(object):
def __init__(self, fiat_auth, predictor):
self.host_ip = None
self.host_mac = None
self.gateway_ip = None
self.packet_processor ... |
client.py | from base64 import b64encode
from engineioN.json import JSONDecodeError
import logging
import queue
import signal
import ssl
import threading
import time
import urllib
import requests
import websocket
from . import exceptions
from . import packet
from . import payload
default_logger = logging.getLogger('engineioN.cli... |
process_worker.py | # coding=utf-8
import multiprocessing
import serial
import socket
import os
import fuckargs
# 串口通讯
# 频率的决定者以硬件的串口通讯频率决定
def get_serial_info( distance ):
os.system( "echo %d >>pid_repo" % os.getpid() ) # store the pid
while True:
line = ser.readline()[:-1]
distance.value = float( line )
# sock... |
skeletonAppiumVirtual.py | ###################################################################
# Skeleton for Appium Virtual Tests on Sauce Labs
####################################################################
###################################################################
# Imports that are good to use
#################################... |
mth_exception.py | from machin.parallel.thread import Thread, ThreadException
import time
def test1():
time.sleep(1)
print(f"Exception occurred at {time.time()}")
raise RuntimeError("Error")
if __name__ == "__main__":
t1 = Thread(target=test1)
t1.start()
while True:
try:
t1.watch()
... |
HogwildSparkModel.py | from flask import Flask, request
import pickle
from sparkflow.ml_util import tensorflow_get_weights, tensorflow_set_weights, handle_features, handle_feed_dict, handle_shuffle
from google.protobuf import json_format
import socket
import time
import tensorflow as tf
import itertools
from sparkflow.RWLock import RWLock
f... |
jobs.py | # -*- coding: utf-8 -*-
#
# 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
#... |
FringeGUI.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 7 09:14:42 2018
@author: mmvillangca
"""
__author__ = "Mark Jayson Villangca"
__copyright__ = "Copyright 2018"
__version__ = "1.0"
__license__ = "MIT"
from PyQt5 import QtCore, QtGui, uic, QtWidgets
from PyQt5.QtGui import QGuiApplicatio... |
test_sftp.py | import os
import stat
import threading
import time
import errno
import py.path
from paramiko import SFTPAttributes
from pytest import fixture, raises
@fixture
def root_path(sftp_server):
return py.path.local(sftp_server.root)
def files_equal(fname1, fname2):
if os.stat(fname1).st_size == os.stat(fname2).st... |
pycoin.py | #!/usr/bin/python
import network
import threading
import blockchain
import code
import logging
import socket
import sys
#logging.basicConfig(format='%(name)s - %(message)s', level=logging.INFO)
chain = blockchain.BlockChain()
server = network.BitcoinServer(hosts=["127.0.0.1"], chain=chain)
server_thread = threading.T... |
test_client.py | import unittest
import threading
import time
from unittest import mock
from sqlflow.client import Client
from tests.mock_servicer import _server, MockServicer
from google.protobuf.timestamp_pb2 import Timestamp
from google.protobuf.any_pb2 import Any
import sqlflow.proto.sqlflow_pb2 as pb
class ClientServerTest(uni... |
webstreaming.py | # USAGE
# python webstreaming.py --ip 0.0.0.0 --port 8000
# import the necessary packages
from pyimagesearch.motion_detection import SingleMotionDetector
from imutils.video import VideoStream
from flask import Response
from flask import Flask
from flask import render_template
import threading
import argparse
import da... |
execution_test.py | from unittest.mock import MagicMock
from concurrent.futures import ThreadPoolExecutor
import concurrent.futures
import platform
import threading
import pytest
import numpy as np
from common import small_buffer
import vaex
def test_merge_aggregation_tasks():
df = vaex.from_arrays(x=[1, 2], y=[2, 3])
binners ... |
train_nav.py | import time
import argparse
from datetime import datetime
import logging
import numpy as np
import os
import torch
import torch.nn.functional as F
import torch.multiprocessing as mp
from models import NavCnnModel, NavCnnRnnModel, NavCnnRnnMultModel, NavPlannerControllerModel
from data import EqaDataLoader
from metrics ... |
text_preprocessing.py | # © 2020 Nokia
#
# Licensed under the BSD 3 Clause license
#
# SPDX-License-Identifier: BSD-3-Clause
# ============================================
import re
import time
from threading import Thread
from traceback import print_exc
import spacy
from codesearch.stopwords import stopwords
def async_fn(f):
def wra... |
dense_update_ops_no_tsan_test.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... |
server.py | """
A high-speed, production ready, thread pooled, generic HTTP server.
For those of you wanting to understand internals of this module, here's the
basic call flow. The server's listening thread runs a very tight loop,
sticking incoming connections onto a Queue::
server = HTTPServer(...)
server.start()
->... |
Magma.py | '''
Created on Mar 29, 2020
@author: riteshagarwal
'''
import random
from BucketLib.BucketOperations import BucketHelper
from BucketLib.bucket import Bucket
from TestInput import TestInputSingleton
from basetestcase import BaseTestCase
from couchbase_helper.documentgenerator import doc_generator
from error_simulatio... |
run_server.py | # Copyright 2019 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, ... |
Camera.py | #-*- coding: utf-8 -*-
import cv2
import time
import os
import datetime
from threading import Thread
from multiprocessing import Queue
class Camera:
def __init__(self, mirror=False):
self.data = None
self.cam = cv2.VideoCapture(0)
self.WIDTH = 640
self.HEIGHT = 480
self.c... |
rate_limiter_test.py | # Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. 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... |
echo_ctx.py | """Echo server using context."""
import contextlib
import sys
import threading
import nng
def main(argv):
if len(argv) < 3:
print('usage: %s url num_ctxs' % argv[0], file=sys.stderr)
return 1
url = argv[1]
num_ctxs = int(argv[2])
with contextlib.ExitStack() as stack:
sock... |
node.py | import threading
import sys
import socket
import time
import os
import pathlib
import shutil
localhost = "127.0.0.1"
broadcast_print = False
SEARCH_REFRESH_RATE = 3
DEBUG_MODE = not True
class Node:
def __init__(self, id):
self.id = int(id)
self.port = 50000 + self.id
self.addr = (localh... |
scenarioselect.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import io
import sys
import time
import datetime
import threading
import shutil
import subprocess
import wx
import cw
import message
import charainfo
import text
import select
import scenarioinstall
from cw.util import synclock
_lockupdat... |
topo.py | #!/usr/bin/python
# Copyright 2013-present Barefoot Networks, 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 ap... |
utils.py | import logging
import os
# -------------------------------------------------------------------------------------------------
_INT_BASES = {"0b": 2, "0o": 8, "0x": 16}
_HSIZE_SUFFIXES = {"b": 1, "k": 1 << 10, "m": 1 << 20, "g": 1 << 30}
def str2bool(val: str):
return val.lower() in ("y", "yes", "on", "true", "1"... |
ManagerAgentWorker.py | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
'''BlendNet Manager Agent Worker
Description: Interacting with Agent and watch on the status
'''
import time # We need timestamps
import threading # Sync between threads needed
import json
from enum import Enum
from . import providers
from .AgentClient import AgentClient
fr... |
Client.py | import json
import socket
import ssl
import urllib.request
from enum import Enum
import time
from threading import Thread
import concurrent.futures
import os
HOST = "www.koolkidz.club"
PORT = 4578
TARGET_SERVER = "mc.koolkidz.club"
API_URL = "https://api.mcsrvstat.us/2/" + TARGET_SERVER
context = ssl.SSLContext(ssl.PR... |
plotting.py | import time
import threading
from ..base_components import CustomWidget
from .._component import Component, register_props
from ..qt import QT_VERSION
if QT_VERSION == "PyQt5":
from PyQt5 import QtWidgets
from PyQt5 import QtCore
else:
from PySide2 import QtCore, QtWidgets
try:
MATPLOTLIB_LOADED = Tru... |
trigger_monitor.py | #!/usr/bin/python
"""
BLACKBOX
Version 0.0.1, March 2019
http://rosin-project.eu/ftp/blackbox
Copyright (c) 2019 PPM Robotics AS
This library is part of BLACKBOX project,
the Focused Technical Project BLACKBOX - an automated trigger-based
reporting, data recording and playback unit for ROS.
Supported by ROSIN - RO... |
handler.py | """
Handler for the reverse shell, You may not be able to
communicate with help of netcat unless you can decode base85 on your brain ;)
"""
import argparse
import sys
import socket
import base64
import threading
import time
__title__ = "handler"
__description__ = "Handler for reverse_shell"
__license__ = "Apache 2.0"
... |
chatroom-client.py | """
Author : Jacob
Email : jacob7154@qq.com
Env : python3
Time : 2021-8-15
GroupChat Project
"""
from socket import *
from multiprocessing import Process
# Address of Server
HOST = "0.0.0.0"
PORT = 7500
ADDR = (HOST, PORT)
def login(sock):
while True:
name = input("Please input your name >>> ")
... |
exercise2_with_threads.py | #!/usr/bin/env python
"""
Create a file named 'my_file.txt' with some random content in it.
Use Netmiko's secure copy to transfer this file to the Arista1, Arista2, Arista3, and Arista4
switches.
Note, you will need to use PIP to upgrade Netmiko in the lab environment to Netmiko 2.1.1 to
complete this exercise:
pip ... |
ros-inj-tool.py | #!/usr/bin/env python2.7
import rospy
from geometry_msgs.msg import Twist
from std_msgs.msg import MultiArrayLayout, MultiArrayDimension, Float64MultiArray, Bool, String
from sensor_msgs.msg import Image
import Queue
import configparser
import threading
import time
import message_filters
import random
import numpy
impo... |
start_ui_node.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# This script reads parameters from rosparam server and creates a symbolic link
# to the urdf package directory, which is denoted by urdf_package_name parameter,
# in the 'packages' directory. Thus the web client can download the meshes that are
# defined in the URDF file.... |
test_target_codegen_vulkan.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... |
payloadRepo.py | from queue import Queue
from threading import Thread
from commands.download.downloadCommandParams import DownloadCommandParams
from commands.download.payloadDownloadCommand import PayloadDownloadCommand
from workers.downloadWorker import DownloadWorker
from domain.interfaces.downloadable import Downloadable
class Payl... |
andinox1.py | # _ _ _
# / \ _ __ __| (_)_ __ ___ _ __ _ _
# / _ \ | '_ \ / _` | | '_ \ / _ \| '_ \| | | |
# / ___ \| | | | (_| | | | | | (_) | |_) | |_| |
# /_/ \_\_| |_|\__,_|_|_| |_|\___/| .__/ \__, |
# |_| |___/
# by Jakob Groß
import subpr... |
callback.py | from utlis.rank import setrank,isrank,remrank,remsudos,setsudo,GPranks,IDrank
from utlis.send import send_msg, BYusers, Sendto, fwdto,Name,Glang,getAge
from utlis.locks import st,getOR,Clang,st_res
from utlis.tg import Bot
from config import *
from pyrogram import ReplyKeyboardMarkup, InlineKeyboardMarkup, InlineKeybo... |
main.py | """Slack app to perform safety checks and monitoring for people working alone."""
import os
import time
import logging
from flask import Flask, request
from slack import WebClient
from slack import errors
from slackeventsapi import SlackEventAdapter
import ssl as ssl_lib
import certifi
import database as db
import date... |
test.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import threading
import operator
import unittest
import time
import sys
import gc
import lupa
IS_PYTHON3 = sys.version_info[0] >= 3
try:
_next = next
except NameError:
def _next(o):
return o.next()
unicode_type = type(IS_PYTHON3 and 'a... |
scheduler_job.py | # -*- coding: utf-8 -*-
#
# 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
#... |
refresher.py | from multiprocessing import Process, active_children
from flask import redirect
from constants import CSV_ROOT
from named_shortlinks import setup_named_shortlinks
from ok_server_interface import setup_ok_server_interface
from preloaded_tables import setup_preloaded_tables
from shortlink_generator import setup_shortl... |
Mobilesploit.py | """
Mobilesploit
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMM MMMMMMMMMM
MMMN$ vMMMM
MMMNl MMMMM MMMMM JMMMM
MMMNl MMMMMMMN NMMMMMMM JMMMM
MMMNl MMMMMMMMMNmmmNMMMMMMMMM JMMMM
MMMNI MMMMMMMMMMMMMMMMMMMMMMM jMMMM
MMMNI MMMMMMMMMMMMMM... |
locusts.py | # encoding: utf-8
import io
import multiprocessing
import os
import sys
from .logger import color_print
from . import loader
from locust.main import main
def parse_locustfile(file_path):
""" parse testcase file and return locustfile path.
if file_path is a Python file, assume it is a locustfile
... |
gui.py | import curses
from curses import wrapper
import time
import random
from random import randint
import math
import threading
import buffer
import asciiart
import strings
import state
stdscr = None
def init_screen():
global stdscr
stdscr = curses.initscr()
curses.echo(False)
curses.start_color()
... |
main.py | # coding=utf-8
import MySQLdb
from queue import Queue
import socket
import json
from time import sleep
import threading
import os
mutex = threading.Lock() # queue mutex
queue = Queue() # 全局判题列表
myjsonfile = open("./setting.json", 'r')
judgerjson = json.loads(myjsonfile.read())
if os.environ.get("DB_USER"):
ju... |
prom_client.py | """Implement Prometheus client."""
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2019 The Contributors
#
# Licensed under the Apac... |
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... |
sync_menu.py | from PyQt5.QtWidgets import QDialog, QVBoxLayout, QLineEdit, QHBoxLayout, QLabel, QPushButton, QGroupBox, \
QMessageBox, QCheckBox, QWidget, QFileDialog, QApplication, QComboBox, QTableWidget, QTableWidgetItem, \
QDialogButtonBox, QGridLayout, QHeaderView, QTableView, QAbstractItemView
import sip
import threadi... |
parallel_envs.py | """
Code in this file is mostly taken from OpenAI Baselines repository:
https://github.com/openai/baselines/tree/master/baselines
"""
from abc import ABC, abstractmethod
import numpy as np
from multiprocessing import Process, Pipe
from gym import spaces
from receptor import logger
def worker(remote, parent_remote,... |
meryXmas.py | #####################################################################
#####################################################################
#####################################################################
# ___ _ _ _____ _____ ______ _____ _____
# / _ \ | | | ||_ _|| _ || ___ \| ___|/ ___|
#/ /_\ \... |
timeout_guard.py | ## @package timeout_guard
# Module caffe2.python.timeout_guard
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import contextlib
import threading
import os
import time
import signal
import logging
'''
Sometimes CUDA ... |
viewerclient.py | from __future__ import absolute_import, division, print_function
import time
import json
import os
import tempfile
import threading
from collections import defaultdict, Iterable
import numpy as np
from lcm import LCM
from robotlocomotion import viewer2_comms_t
from director.thirdparty import transformations
class Cl... |
workbench.py | # -*- coding: utf-8 -*-
import ast
import collections
import importlib
from logging import getLogger
import os.path
import pkgutil
import platform
import queue
import re
import shutil
import socket
import sys
import tkinter as tk
import tkinter.font as tk_font
import traceback
from threading import Thread
from tkinter... |
recorder.py | import os
import json
import threading
import saveSession
from wx.lib.pubsub import pub
def split_children(current, commands):
for i in range(len(commands)):
if commands[i][2]["depth"] <= current[2]["depth"]:
return commands[:i], commands[i:]
return commands, []
def translate_structural... |
monitor.py | # curio/monitor.py
#
# Debugging monitor for curio. To enable the monitor, create a kernel
# and then attach a monitor to it, like this:
#
# k = Kernel()
# Monitor(k)
#
# If using the run() function, you can do this:
#
# run(coro, with_monitor=True)
#
# run() also looks for the CURIOMONITOR environment variabl... |
test_31.py | import unittest
import string
import time
import requests
import random
import http.server
import socketserver
from urllib.parse import urlparse
from urllib.parse import parse_qsl
from http import HTTPStatus
from multiprocessing import Process
from crypto.hmac import hmac_sha1
from util.bettercode import random_word
... |
push_main.py | #the main python file to excute the complete push assisted task
import time
import os
import random
import threading
import argparse
import matplotlib.pyplot as plt
import numpy as np
import scipy as sc
import cv2
from collections import namedtuple
import torch
from torch.autograd import Variable
from robot import Robo... |
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... |
trim_primers.py | """
Experimemtal code for trimming primers & polyA tails from high error rate long reads
"""
from csv import DictWriter
from dataclasses import dataclass
from multiprocessing import Process
from pathlib import Path
from typing import List, Optional, Union
import parasail
import typer
from Bio import SeqIO
from Bio.Seq... |
matrixlock.py | #!/usr/bin/python3
from argparse import ArgumentParser
from http.server import BaseHTTPRequestHandler, HTTPServer
from os.path import dirname, join
from subprocess import run, Popen, DEVNULL
from threading import Thread, Event
from time import time
import json
def main(matrix_delay_secs):
workspaces = get_workspace... |
flask.py | from flask import Flask, render_template
import pandas as pd
import numpy as np
from typing import List, Dict
from flask_restful import Resource, Api
import time
import threading
ARTICLES_REFRESH = 900 # 15 min
app = Flask(__name__)
api = Api(app)
lock = threading.Lock()
def periodic_update():
# possibl... |
cisd.py | #!/usr/bin/env python
# Copyright 2014-2021 The PySCF Developers. 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
#
# U... |
__init__.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
pywebview is a lightweight cross-platform wrapper around a webview component that allows to display HTML content in its
own dedicated window. Works on Windows, OS X and Linux and compatible with Python 2 and 3.
(C) 2014-2019 Roman Sirokov and contributors
Licensed under B... |
_instanceinfo.py | # -*- coding: utf-8 -*-
"""
INSTANCE INFO:
-----------------
This module is a copy of the code created by TheoRet at StackOverflow
TheoRet profile:
https://stackoverflow.com/users/7386061/theoret
Link to the question/answer:
https://stackoverflow.com/questions/1690400/getting-... |
zlib_server.py | import zlib
import logging
import socketserver
import binascii
BLOCK_SIZE = 64
class ZlibRequestHandler(socketserver.BaseRequestHandler):
logger = logging.getLogger('Server')
def handle(self):
compressor = zlib.compressobj(1)
filename = self.request.recv(1024).decode('utf-8')
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.